Add prepared urban route guidance to Gaussian simulation planning
Introduce a content-bound scene route provider, advisory runtime graph and plan-preview-launch workflow. Preserve live sensing authority and retire blocked intermediate goals without discarding final-arrival evidence. Bound native visual context losslessly and provide verified cache relocation. Full Maroseyka route qualification remains open.
This commit is contained in:
@@ -23,7 +23,7 @@ def digest(path):
|
||||
return hashlib.file_digest(stream, "sha256").hexdigest()
|
||||
|
||||
|
||||
def prepare_project(client, run, state, episode, job, pulse):
|
||||
def prepare_project(client, run, state, episode, job, pulse, isaac):
|
||||
world = run["world"]
|
||||
package = client.request("/worker/worlds/" + world["world_id"] + "/project-assets")
|
||||
if package["world_sha256"] != world["sha256"]:
|
||||
@@ -86,13 +86,20 @@ def prepare_project(client, run, state, episode, job, pulse):
|
||||
# Keep 12 m of surrounding visual context in every direction. A saved route
|
||||
# bounds the adaptation. Retain LOD0 and all SH bands without a count ceiling.
|
||||
points = run["plan"]["points"]
|
||||
prior = run["plan"].get("prepared_route")
|
||||
if prior:
|
||||
# A curved A/B route needs its entire preview, not just its endpoints.
|
||||
# Unselected graph branches must not force the whole city into RTX.
|
||||
# Long detours outside this visual region require spatial streaming;
|
||||
# the graph never substitutes for live support in such an area.
|
||||
points = points + [{"position": p} for p in prior["preview_xyz"]]
|
||||
xyz = [[p["position"][0], p["position"][2], -p["position"][1]] for p in points]
|
||||
bounds = [min(p[i] for p in xyz) - 12 for i in range(3)] + [
|
||||
max(p[i] for p in xyz) + 12 for i in range(3)
|
||||
]
|
||||
key = hashlib.sha256(
|
||||
json.dumps(
|
||||
{"world": world["sha256"], "bounds": bounds, "adapter": digest(Path(__file__))},
|
||||
{"world": world["sha256"], "bounds": bounds, "adapter": digest(Path(__file__)), "region_adapter": digest(Path(__file__).with_name("route_region.py"))},
|
||||
sort_keys=True,
|
||||
).encode()
|
||||
).hexdigest()
|
||||
@@ -136,23 +143,33 @@ def prepare_project(client, run, state, episode, job, pulse):
|
||||
"0,0,180",
|
||||
str(temporary),
|
||||
]
|
||||
commands = [command]
|
||||
filtered = temporary.with_suffix(".region.ply")
|
||||
if prior:
|
||||
region = episode / "visual-region.json"
|
||||
write_json(region, {"route_xz": [[p[0],-p[1]] for p in prior["preview_xyz"]],
|
||||
"radius_m": 12, "authority": "visual-context-only"})
|
||||
commands.append([str(isaac / "python.bat"), str(Path(__file__).with_name("route_region.py")),
|
||||
"--source",str(temporary),"--output",str(filtered),"--region",str(region)])
|
||||
with (episode / "project-preparation.log").open("wb") as log:
|
||||
process = subprocess.Popen(command, stdout=log, stderr=subprocess.STDOUT)
|
||||
job.assign(process)
|
||||
deadline = time.monotonic() + 600
|
||||
try:
|
||||
while process.poll() is None:
|
||||
pulse()
|
||||
if time.monotonic() > deadline:
|
||||
raise TimeoutError("Project preparation timed out")
|
||||
time.sleep(1)
|
||||
if process.returncode:
|
||||
raise RuntimeError("SOG adaptation failed; inspect Worker evidence")
|
||||
finally:
|
||||
if process.poll() is None:
|
||||
from worker import terminate_episode
|
||||
|
||||
terminate_episode(process)
|
||||
for command in commands:
|
||||
process = subprocess.Popen(command, stdout=log, stderr=subprocess.STDOUT)
|
||||
job.assign(process)
|
||||
deadline = time.monotonic() + 600
|
||||
try:
|
||||
while process.poll() is None:
|
||||
pulse()
|
||||
if time.monotonic() > deadline:
|
||||
raise TimeoutError("Project preparation timed out")
|
||||
time.sleep(1)
|
||||
if process.returncode:
|
||||
raise RuntimeError("SOG adaptation failed; inspect Worker evidence")
|
||||
finally:
|
||||
if process.poll() is None:
|
||||
from worker import terminate_episode
|
||||
terminate_episode(process)
|
||||
if prior:
|
||||
filtered.replace(temporary)
|
||||
with temporary.open("rb") as f:
|
||||
header = f.read(65536).split(b"end_header", 1)[0].decode("ascii")
|
||||
count = int(re.search(r"element vertex (\d+)", header)[1])
|
||||
|
||||
Reference in New Issue
Block a user