sim_learning+agent_sdk: open-loop rollout residuals, combined-substrate probe, solve-prompt strategy blocks (sysID stack 8/8) - #103
Merged
Conversation
_TypedEntity._hash caches hash(str(self)), which is salted per process (PYTHONHASHSEED); pickling the cache made every State.data lookup on objects loaded in another process miss its dict bucket (KeyError on fit_data pickles consumed offline, which exist precisely for offline post-mortems). __getstate__ now drops the cached _hash/_str and __setstate__ scrubs legacy payloads on load.
…en-loop residuals Three fixes from the 2026-07-27/28 al_margin seed1+seed2 post-mortems: - Belief-side cascade probe replays on the combined substrate (base sim plus fitted process rules via BaseEnv.probe_process_model_factory, stamped by the approach at both option-model build sites and on fresh-env repoints); the real evaluator never sets a factory and still judges pure env physics. A passing combined verdict is double-checked base-only at the SAME attempt count as a load-bearing diagnostic; the earlier 3-vs-1 attempt asymmetry flagged physically no-op rules as load-bearing 14 times in run_20260728_111805. - Cross-cycle INCONSISTENT holds are arbitrated on pooled evidence: the orchestrator hands its survivor-set SSE probe to the report adjuster, and a flagged jump that explains the pooled segments code_sim_learning_rollout_consistency_sse_ratio (3.0) times better than the held value is accepted. run_20260727_210827 held a sharp biased cycle-0 fit (0.9313) over the pooled-best 0.4748 all run. - sim.residuals(rollout=True): open-loop counterpart of the teacher-forced residual report. Replays the recorded trajectories free-running (fresh env per rollout, the system-ID fit objective) and sweeps every env-registry physical parameter across its box with a per-parameter declare/flat verdict; the synthesis prompt now requires this evidence before omitting PHYSICAL_PARAMS. run_20260728_111805 declined to declare on near-zero per-step residuals while the same data was explained two orders of magnitude better near the true friction open-loop.
run_20260728_111806 exhausted all 3 test attempts mid-tune with a correct friction fit and an actionable journal roadmap; give the agent arms two more attempts per task.
The solve agent previously reverse-engineered scores from opaque numbers and induced false reward rules (run_20260729_001752 invented a binary -0.10 flag and a -0.30 excess-blue penalty). The evaluator now publishes the ground-truth arithmetic - success bonus minus block cost times blues consumed, with worked examples - and states that consumed blues cost reward but never invalidate a success.
Four general, non-leaky fixes for the failure modes that cost run_20260729_001752 all five attempts while its sibling banked an over-built solve: - CAPTURE FIRST, OPTIMIZE SECOND in the submit guidance: bank a robust goal-reaching design early; states the verified capture semantics (validated replaces, rejections never displace). - Scoring section: the solve prompt now renders the task evaluator's objective_description, so scores are decoded with the ground-truth rule instead of hypothesized penalties. - Journal epistemics: prompt-side protocol (execute or retire untried leads first, negative claims scoped to the family actually swept, conflicting entries demote to open questions) plus matching scope requirements in record_journal's guidance. - Formula validation in deep-tune advice: validate derived geometric predictions on one controlled experiment before letting them steer the search.
Full-repo mypy (the CI configuration) flagged 12 errors the targeted per-file runs missed: raw _TypedEntity keys where State expects Object, a float64 Action payload, an untyped toolkit helper, Protocol-mismatched _FakeApproach arguments (now cast, as the stub is deliberately partial), and None passed where the probe stepper takes an Action.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Last of eight PRs landing the domino-sysid branch on master in sequence (after #96-#102). Tree is identical to that branch's tip rebased onto current master, plus mypy/pylint cleanups of the newest test files.
This chunk
The open-loop evidence stack:
sim.residuals(rollout=True)free-runs the fit trajectories and sweeps each registry physical parameter so teacher-forced residuals can no longer hide compounding divergence (the run_20260728_111805 failure mode); the belief verdict probes the combined substrate (base sim + learned rules); cross-cycle arbitration pools evidence via survivor-set SSE. Plus the pickled-cached-hash fix (PYTHONHASHSEED-salted hashes broke State lookups cross-process), the env-published exact reward formula, and the solve-prompt strategy blocks (capture-first banking, ground-truth scoring section, journal epistemics, formula validation) from the run_20260729_001752 post-mortem.🤖 Generated with Claude Code