# coding: utf-8 from pathlib import Path import hashlib,json,shutil R=Path('/Users/korizatou114/Projects/とりにく工房ゲーム制作部') A=R/'artifacts/original-completion-2026-10-02' P=A/'p23-02-native-hot-loop-candidate-r326' C=A/'p23-02-native-input-copy-candidate-r333' assert not C.exists() and shutil.disk_usage(A).free>=528*1048576 def pin(p): b=p.read_bytes();return dict(path=str(p),bytes=len(b),sha256=hashlib.sha256(b).hexdigest()) C.mkdir();(C/'source').mkdir();(C/'scripts').mkdir() for rel in ['scripts/guest_service.gd','scripts/simulation_runtime.gd','source/tree_core.hpp','source/tree_numeric_core.cpp','source/guest_candidate_batch.inc']: (C/rel).write_bytes((P/rel).read_bytes()) p=C/'source/tree_numeric_core.cpp';s=p.read_text() anchor=' static bool blocked(const ProjectionNames &n,Object *path, const Vector3i &cell) {' helper=''' // Only StringName keys qualify. Conversion-sensitive and custom runtime // cases retain the original script sorter. No owner values are retained. static Array sorted_builtin_input_names(const ProjectionNames &n,Object *runtime,const Dictionary &inputs) { auto original=[&]() -> Array {return runtime->call(n.k__sorted_name_keys,inputs);}; if(!builtin(n,runtime,"res://autoload/simulation_runtime.gd")) return original(); const Array keys=inputs.keys(); std::vector> rows; rows.reserve(keys.size()); for(int64_t i=0;i result; for(const auto &row:rows) result.push_back(row.second); return result; } // Fresh writable typed output, matching the builtin append loop. Check // the script at this original call position, after any route callbacks. static Variant copy_builtin_guest_route(const ProjectionNames &n,Object *path,const TypedArray &route) { if(!builtin(n,path,"res://scripts/world/path_service.gd")) return path->call(n.k__copy_path,route); TypedArray copied; for(int64_t i=0;i