25 lines
3.5 KiB
Python
25 lines
3.5 KiB
Python
# coding: utf-8
|
|
from pathlib import Path
|
|
import importlib.util,json,shutil,uuid
|
|
R=Path('/Users/korizatou114/Projects/とりにく工房ゲーム制作部');A=R/'artifacts/original-completion-2026-10-02';O=A/'p23-02-native-hot-loop-local-r329';C=A/'p23-02-native-hot-loop-candidate-r326';B=A/'p23-02-native-hot-loop-build-r327'
|
|
s=importlib.util.spec_from_file_location('prepare329',R/'tools/run_all_tests.py');r=importlib.util.module_from_spec(s);s.loader.exec_module(r)
|
|
def pin(p):return dict(path=str(p),bytes=p.stat().st_size,sha256=r.sha(p))
|
|
assert r.read(B/'execution.json')['passed'] and shutil.disk_usage(A).free>=528*1048576
|
|
review=A/'p23-02-native-hot-loop-build-actual-independent-review-r327.json';assert r.read(review)['host_build_accepted']
|
|
old=r.read(A/'p23-02-native-guest-bulk-local-r315/input.json');stage=A/'p23-02-native-guest-bulk-local-r315/stage';parent=Path(old['parent']);assert r.inventory(stage,stage=True)==old['expected_stage'];assert r.inventory(parent,stage=True)==old['parent_stage_inventory']
|
|
private=Path('/private/tmp')/('TheTree-hot-loop-r329-'+uuid.uuid4().hex);private.mkdir();lib=private/'candidate.dylib'
|
|
with lib.open('xb') as f:f.write((B/'libtree_numeric_core.macos.template_debug.dylib').read_bytes())
|
|
assert lib.read_bytes()==(B/'libtree_numeric_core.macos.template_debug.dylib').read_bytes()
|
|
with (O/'candidate.gdextension').open('x') as f:f.write('[configuration]\nentry_symbol="tree_numeric_core_init"\ncompatibility_minimum="4.7.2"\nreloadable=false\n\n[libraries]\nmacos.arm64="'+str(lib)+'"\n')
|
|
fixed=old['pins'].copy()
|
|
updates=dict(host_review=review,host_root=A/'p23-02-native-hot-loop-build-root-verification-r327.json',library=B/'libtree_numeric_core.macos.template_debug.dylib',private_library=lib,config=O/'candidate.gdextension',qa=O/'local.gd',candidate=C/'input.json',candidate_guest=C/'scripts/guest_service.gd',candidate_runtime=C/'scripts/simulation_runtime.gd',candidate_cpp=C/'source/tree_numeric_core.cpp',candidate_include=C/'source/guest_candidate_batch.inc',contract=A/'p23-02-native-hot-loop-work-contract-r325.json',starter=O/'candidate-guarded.gd',runner=A/'p23-02-native-hot-loop-local-r329.py',prepare=Path(__file__),protocol_helper=O/'protocol_helper.gd',protocol_original=A/'p23-02-native-lazy-edge-cache-protocol-r143.gd',protocol_manifest=A/'p23-02-native-bridge-Godot-protocol-preparation-r73/pinned-inputs.json',numeric_execution=A/'p23-02-native-hot-loop-numeric-r328/execution.json',header=C/'source/tree_core.hpp')
|
|
for k,p in updates.items():fixed[k]=pin(p)
|
|
# Pin all 50 frozen full inputs and expected outputs, once; never copy this corpus.
|
|
manifest=r.read(updates['protocol_manifest'])
|
|
for i,row in enumerate(manifest['cases']):
|
|
for kind in ['input','expected']:
|
|
p=Path(row[kind+'_path']);q=pin(p);assert q['sha256']==row[kind+'_sha256'];fixed['protocol_%d_%s'%(i,kind)]=q
|
|
v=old.copy();v.update(pins=fixed,stage=str(stage),source_before=r.source_refs(R),default_before=r.default_player(R),doc4_before={n:r.sha(R/'docs/plans/original-completion-2026-10-02'/n) for n in old['doc4_before']},support_inventory=r.inventory(r.SUPPORT),private_library_inventory=r.inventory(private),original_Guest_fixture=pin(A/'p23-02-native-guest-bulk-local-r315/local-measurement/fixtures.varbytes'),additional_protocol_cases=50,stage_clones=0,expected_duration_seconds=[2,30],capacity_floor_bytes=528*1048576)
|
|
with (O/'input.json').open('x') as f:json.dump(v,f,ensure_ascii=False,indent=2);f.write('\n')
|
|
print(json.dumps(dict(plan=str(O/'input.json'),pins=len(fixed),clone_count=0,free=shutil.disk_usage(A).free)))
|