Skip to content

Build the Wait debug line only at DEBUG, and skip objects the state lacks - #203

Open
yichao-liang wants to merge 1 commit into
masterfrom
wait-debug-absent-objects
Open

yichao-liang wants to merge 1 commit into
masterfrom
wait-debug-absent-objects

Conversation

@yichao-liang

Copy link
Copy Markdown
Collaborator

option_policy_to_policy built _format_wait_target_debug's string on Wait step 1 and every 25 steps whenever an abstract function was wired, even with DEBUG logging off.
The formatter read every target object's features from the state.
Process planning injects ground-truth helper objects (the Fan grid's loc_* cells) only into the planning task and re-derives them inside its abstract function, so the executed state lacks them.
The Fan process-planning oracle on the historical arena (HISTORICAL_ARENA_FLAGS) therefore crashed at its first Wait with KeyError: loc_0.7900_1.6840:loc from State.get.

The wrapper now builds the line only when the root logger is enabled for DEBUG.
The formatter lists a target object the state does not contain as not in state and skips its features, so a debug message can no longer end an episode.

Test plan

  • Two regression tests in tests/test_wait_option_backstop.py run a Wait whose target atom names an object absent from the state.
    With DEBUG on, the debug line reports the object as not in state; below DEBUG, the line is never built.
    On master the first fails with the same KeyError and the second with the stub's AssertionError.
  • Fan process-planning oracle on the historical arena with the issue's command (seed 0, one test task, --timeout 60).
    This branch solves the task: SwitchOn, four Waits that end on their target atoms, SwitchOff.
    Planning alone takes 58-67 s on the cluster's nodes, so at 60 s it timed out on two of three nodes (once on master, in skeleton search; once on this branch, in refinement).
  • The same command with --timeout 400, so that planning always finishes.
    Master finds the same 6-step plan and crashes at the first Wait with the KeyError.
    This branch solves the task in all three runs, one of them with --debug, where all 7 Wait debug lines list the two loc_* cells as not in state.
  • yapf, isort 5.10.1, docformatter, mypy and pylint on the whole tree.
  • The 8 pytest shards.

🤖 Generated with Claude Code

…acks

option_policy_to_policy built _format_wait_target_debug's string on Wait
step 1 and every 25 steps whenever an abstract function was wired, even
with DEBUG logging off, and the formatter read every target object's
features from the state. Process planning injects ground-truth helper
objects (the Fan grid's loc_* cells) only into the planning task and
re-derives them inside its abstract function, so the executed state
lacks them: the Fan process-planning oracle on the historical arena
crashed at its first Wait with KeyError: loc_0.7900_1.6840:loc.

The wrapper now builds the line only when the root logger is enabled
for DEBUG, and the formatter lists a target object the state does not
contain as "not in state" without reading its features.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant