Repository navigation
US base: check the policyengine-us lock file once per run, and import torch only where it is used - #1750
Merged
Conversation
…check Every process that imports microcosm.build.us_runtime derives engine_abi.lock.json afresh from the installed policyengine-us (two tax-benefit system builds and an index of policyengine-us source) and compares bytes. These tests describe a record of a passed check that a process hands its children: - a passed check records the lock file's SHA-256, the installed policyengine-us version and the SHA-256 of the take-up and sources domains, bound to the issuing process ID; - a child that receives its parent's record compares those values instead of deriving the lock, and refuses a lock file, installed policyengine-us or domains that differ, or a malformed record; - a record issued by any process other than the parent is ignored, and a process with no record still runs the full check; - the base tool's step processes, the QRF workers and the QRF worker identity's import trace receive the record; - real step and QRF worker processes refuse to start when the lock file or the installed policyengine-us differs from the record, and start without importing policyengine-us when it matches. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…en a record A process that passes the full check of engine_abi.lock.json now remembers what it compared: the lock file's SHA-256, the installed policyengine-us version and the SHA-256 of the take-up and sources domains. engine_abi_lock_check_environment() hands that record, bound to the issuing process ID, to the processes it starts through MICROCOSM_ENGINE_ABI_LOCK_CHECK_RECORD. A process holding a record issued by its own parent reads the lock file and compares the three values instead of deriving the lock afresh (two tax-benefit system builds and an index of policyengine-us source). It refuses to run when the lock file, the installed policyengine-us or the domains differ, or the record is malformed. A process with no record, or one issued by any other process, runs the full check as before. The base tool's --stage all process passes its record to each step process. primary_qrf_worker_launch_environment() passes the calling process's record to the QRF workers and to the clean import trace behind the QRF worker identity, so that trace opens the same files however the process computing the identity was started. The identity digest changes once: the trace no longer opens gate_shadow.py, multispine_pool.py or us_late_overlap_ownership.py. Measured on a 10-core Mac at load average 5-6, median of 3 starts: a step process start fell from 37.8 s and 1.54 GB peak RSS to 9.0 s and 0.47 GB, and a QRF worker start from 36.6 s and 1.75 GB to 9.1 s and 0.46 GB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
run_primary_puf_qrf_chain starts the QRF workers from the step process. When its caller passes no environment, as the base tool's primary_qrf_chain step does, each worker only inherits the step process's environment, whose record was issued by the --stage all process. The worker's parent is the step process, so it ignores that record and still derives the lock afresh. The test requires every worker the chain starts to receive the record of the step process's own check, with or without a caller environment. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
run_primary_puf_qrf_chain now adds us_engine_abi_lock_check_environment() to every worker's environment, whether or not its caller passes an environment. The base tool's primary_qrf_chain step passes none, so its workers previously inherited only the --stage all process's record, which they ignore because their parent is the step process, and each one derived the lock afresh. tools/build_us_multispine_pool.py calls the chain the same way and gains the same. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Importing microcosm.calibrate imports microcosm.calibrate.solve, whose module-level `import torch` (and its import of HardConcrete from gates) loads torch in every US base step process and QRF worker, about 1.4 s and 100-200 MB each, although none of them calibrates. The tests require that importing the calibration package, or starting a base step process or QRF worker, does not import torch, and that a solver function that uses torch imports it on first use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
microcosm.calibrate.solve imported torch, and HardConcrete from microcosm.calibrate.gates, at module level. Every importer of microcosm.calibrate therefore loaded torch, including each US base step process and QRF worker, none of which calibrates. The twelve solve functions that use torch at run time now import it themselves, and _optimize imports HardConcrete; annotations keep their TYPE_CHECKING imports. No computation changes: the pre-change optimizer comparisons in test_l2_basis.py and test_solve.py still return identical bytes. solve.py and puf_qrf_chain.py are among the sources whose digest the spec engine's legacy-v1 seed protocol records (it is recorded, not used to draw), so these move, re-pinned with tools/repin_us_spec_engine_contracts.py: - EXPECTED_HASHES seed_map and seed_protocol in inventory_coverage.py; - docs/evidence/spec-engine/us-f0-coverage.json; - the spec_sha256 pins in test_spec_engine_loader.py and test_us_multispine_pool_tool.py. The helper-source pins for _apply_constraint and _relative_error_loss in pre_best_iterate/controls.json and test_l2_basis.py move because both helpers now begin with `import torch`. With the lock-check record, a step process start now takes 6.3 s and 0.30 GB peak RSS and a QRF worker start 8.4 s and 0.29 GB (median of 3 on a 10-core Mac at load average 5), against 37.8 s / 1.54 GB and 36.6 s / 1.75 GB before this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 1 of review noted that a child compares only the policyengine-us version string. State that a same-version reinstall or a changed policyengine-core during a run is not noticed by a child with a record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_stacked_worker_first_torch_import_forces_autoload_off exited at the worker's first torch import, which used to happen while the worker's parent packages loaded. Now that microcosm.calibrate.solve imports torch inside the functions that use it, loading the worker imports no torch, so the child reached main() and failed on the test's placeholder manifest. The child now loads the worker module, checks that torch is still absent, then makes the process's first torch import itself and records the same controls, plus the device-backend setting the launcher passed before the worker module could set its own. Also correct three comments that said solve imports torch at load time, or that step processes pass the parent's record on to their QRF workers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
test_the_full_us_bundle_loader_accepts_the_parents_record asserted only the child's exit code, which a child that ignored the record and ran the full check would also pass. It now also requires that the child imports no policyengine-us. The changelog now says that the QRF workers of the multispine pool tool and the release tool's stacked spine receive a record too, since run_primary_puf_qrf_chain adds it for every caller. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After rebasing onto main (which moved the same pins for #1686's shared SIPP read), re-run tools/repin_us_spec_engine_contracts.py in its documented order, twice so the coverage test's covered-item count is taken after the seed digests are current, then tools/spec_engine_coverage.py and the re-pin tool's --check: - EXPECTED_HASHES seed_map and seed_protocol in inventory_coverage.py; - docs/evidence/spec-engine/us-f0-coverage.json; - the spec_sha256 pins in test_spec_engine_loader.py and test_us_multispine_pool_tool.py, each with a line saying why it moved. calibrate.adam@1's implementation hash covers solve.py's bytes, so re-pin the calibrate graph parity case with tools/graph_parity_repin.py on arm64/darwin/py3.14, the platform it was recorded on. The tool refuses if the kernel's output bytes move; they did not. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- The refusal messages no longer repeat engine_abi.lock.json, which SpecValidationError already prints from its source. - The _LockCheckInputs docstring says only direct children act on a record, since every descendant can inherit the variable. - docs/spec-engine.md says a process issues a record after the full comparison or after matching its own parent's record. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main changed solve.py (weights bounded against a declared reference) and re-pinned the same digests this branch moves. The five pin files that conflicted take main's side and are regenerated on the merged tree: - tools/repin_us_spec_engine_contracts.py in its documented order, run twice, then tools/spec_engine_coverage.py (42404/42404 fields, 41/41 inventory checks) and --check: EXPECTED_HASHES seed_map and seed_protocol, docs/evidence/spec-engine/us-f0-coverage.json, and the spec_sha256 pins in test_spec_engine_loader.py and test_us_multispine_pool_tool.py, with this branch's reason lines added after main's; - tools/graph_parity_repin.py calibrate on arm64/darwin/py3.14; the kernel's output bytes did not move. Main's new solve.py code uses torch only inside functions that already import it, and nothing in solve.py imports torch at module level. The solver helper-source pins still match. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
marked this pull request as ready for review
November 26, 2026 14:16
juaristi22
reviewed
Nov 26, 2026
juaristi22
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed at 5ba293efb. A child with its parent's record refuses every mismatch it should, nothing a step computes depends on what this moves, and nothing on our side blocks it.
On your open points:
- The bit-equivalence run: not needed for this change. torch takes its thread count from the environment at its first parallel operation, not at import (checked with torch 2.12.0), so the solve keeps its thread count and summation order. Nothing in microcosm reads the recursion limit or the warnings filters that importing policyengine-us used to set. That import also drew once from Python's global
random(inrich.style), and the only microcosm code using it, the QRF's leaf shuffle, seeds it first. - Engine matched by version only: enough. On Modal the image fixes both packages, and during a local run the full check caught a policyengine-core change only when it changed the derived lock, whose engine entry names policyengine-us alone.
- The Modal plan variable: fine as a follow-up; refusing it as
MICROCOSM_TELEMETRY_PARENT_PIDis refused would close it.
For UK builds, as with #1746: merging moves calibrate.adam@1, whose hash every UK solve kernel embeds, and uk.full.problem@1, which hashes calibrate.solve itself. The next UK full build therefore re-solves, and a dense build run with --require-solve-reuse against a store written before the merge stops with SolveReuseError. It's worth merging between such a pair, not in the middle.
What I checked
- With policyengine-us 2.2.1 and real processes, a child with its parent's record imports neither policyengine-us nor torch: a step-tool start takes 6.1 s and 0.30 GB instead of 31.5 s and 1.69 GB, and a QRF worker start 5.7 s and 0.29 GB instead of 27.4 s and 1.63 GB.
- A child refuses a record with a different lock SHA-256, engine version or domains digest, or one that isn't JSON, and ignores a record from any process other than its parent, so it runs the full check.
- All 13 functions in
solve.pythat use torch orHardConcreteimport them, and the new order (scikit-learn's OpenMP before torch's) runs on macOS. The seed formula doesn't read the source digests, so the movedseed_mapandseed_protocolpins change no draw. - All 190 targeted engine-free tests (among them the whole of
test_solve.pyandtest_l2_basis.py, andtest_h1_kernel_parityon the calibrate pin's own platform) and the 16 that need policyengine-us pass locally, as dorepin_us_spec_engine_contracts.py --checkandspec_engine_coverage.py. It merges cleanly with #1737 and #1747, and CI is green apart from engine-free, which is still running.
Review of #1750 noted that calibrate.adam@1, whose hash every UK solve kernel embeds, and uk.full.problem@1 both hash calibrate.solve, so the torch import move re-keys the UK solve: a build run with --require-solve-reuse against a graph store written before the merge stops with SolveReuseError. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anth-volk
added a commit
that referenced
this pull request
Nov 26, 2026
Brings in task 1.5 · 1, which adds the policyengine-us lock-file check record to _staged_subprocess_environment. No conflicts: this branch merges MICROCOSM_US_BASE_PARENT_DIGESTS on top of that environment in _run_staged_all, and the two use different variables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
juaristi22
added a commit
that referenced
this pull request
Nov 26, 2026
…nd, the table_copies hash binding, and US and NZ changes (#931) Main took five pull requests since e29843d: #1734 (New Zealand's receipt target cap), #1749 (staging hands a run's files over at its start and its results at its end, with no upload interval), #1761 (the UK stage, population and calibration hashes bind microcosm.frame.table_copies), #1725 (the US post-export merged baseline sweep) and #1750 (the US base engine lock checked once). No UK feed or engine pin moves. Eight files conflicted. - uk_runtime/graph_calibration.py, graph_kernels.py and graph_population.py: #1761 binds table_copies into the stage, population and calibration hashes; this branch already binds it, as frame_table_copies, in every UK kernel that computes through it (bbe3633), so the merge keeps this branch's side. The population kernels #1761 binds are gone on the clone-first spine, so its new test in test_uk_kernel_frame_copies holds the national problem kernel, which copies through context_frame, in their place, with the pool checkpoint kernel as the control. - test_uk_rowwise_candidate: #1749's dense role without an upload interval; this branch's removal of the constituency vintage stays. - The US seed map and seed protocol, the loader's golden spec vector and the US pool test's spec pin, computed on the merged tree, and the US F0 coverage report, regenerated (--check passes, and so does the US re-pinner's --check). The UK gate contract pins, the stage table and the coverage manifest are current on the merged tree. Checks: with policyengine-uk hidden, as in CI's engine-free job, the tests main's five pull requests change, the UK graph's binding rules, the kernel frame copies (main's new test among them), the clone-first nesting, the transport binding rule and identity, the graph parity pins, the spec-engine loader and the Child Benefit stage and gate tests (2,729 pass); the US coverage report and pins (--check); and the UK gate pins, the stage table and the coverage manifest (--check). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Tracker task 1.5 · 1 (project "15. US build memory, CPU and run time", substage 1.5 "Base stage fixed costs").
What this changes
Every process that imports
microcosm.build.us_runtimebuildsUS_SPINE_AGREEMENT_REGISTRYat module load. That loads the US take-up contract, which runsassert_engine_abi_lock_current: it derivesengine_abi.lock.jsonafresh from the installed policyengine-us and compares bytes. The derivation imports policyengine-us, builds two tax-benefit systems (PolicyEngineUSEngine().take_up_contract()) and indexes policyengine-us's source code for the remaining-stage input manifest. A--stage allbase run starts 90 such processes: 24 step processes, and 66 QRF workers (one per QRF variable) insideprimary_qrf_chain. The tracker counts these as 89.After this change:
assert_engine_abi_lock_currentpasses the full comparison, the process remembers what it compared: the lock file's SHA-256, the installed policyengine-us version, and the SHA-256 of the canonical JSON of the take-up and sources domains.engine_abi_lock_check_environment(root)returns that record asMICROCOSM_ENGINE_ABI_LOCK_CHECK_RECORD, with the issuing process's ID.--stage alladds it to each step process's environment (_staged_subprocess_environment, one added call).run_primary_puf_qrf_chainadds its caller's own record to every QRF worker it starts, whether or not the caller passes an environment. The base tool'sprimary_qrf_chainstep passes none. An inherited record would not do: its issuer is the worker's grandparent, so the worker would ignore it.tools/build_us_multispine_pool.pycalls the chain the same way, so its workers benefit too. Review round 1 caught that, without this, the base stage's workers still ran the full check.primary_qrf_worker_launch_environment()adds the calling process's record too. That environment is used for the QRF workers the release tool's stacked spine starts and for the clean import trace behind the QRF worker identity.issuer_pid == os.getppid()) does not derive the lock. It reads the lock file and refuses to run when:It still checks that the lock is valid against its schema and names the recorded engine version. It then issues the same record to its own children.
--stagerun by hand, the release tool, tests and every other importer. The process-ID binding follows the existingTELEMETRY_PARENT_PID_VARIABLErule, so a record inherited through an intermediate process is ignored instead of trusted.What the record is keyed on, and why
take_up.yamlthrough the lock its parent checked against the old one.builder_code_identity), not this record's.RECORDdigest could be added cheaply if wanted.The other option: build the registry on first use
I checked whether building
US_SPINE_AGREEMENT_REGISTRYon first use would, on its own, keep the check out of the base processes. I tried it with the registry assignment temporarily replaced by an empty tuple.graph.py(whose module-level_ROOT_CELLSreads it), the QBI reconciliation validations inmultispine_pool,register_consistencyand the local-area take-up. This is from reading the code, not from a run.us_runtimefrom checking the lock file for every other importer. This PR keeps the parent record as the tracker title asks. Combined with a lazy registry, each worker start would drop by a further ~3 s (YAML loading, schema validation and the registry build). That would also need each QRF worker to check the record explicitly at start, so it still refuses a changed lock file. Left as a possible follow-up.Measurements
Wall time and peak resident set size (
ru_maxrssfromwait4) of one process start, measured from a Python driver that issues the record and starts each child itself. Each child runs--help, so it does its imports, including the lock check, and exits. The figures are medians of 3 starts on a 10-core, 32 GB Mac at load average 5–6 from other sessions, so they run higher than the tracker's idle-machine 21–26 s.tools/build_us_puf_support_base.py --help):python -m microcosm.build.us_runtime.puf_qrf_worker --help):--stagerun, the release tool), a start still runs the full check: 36.5 s and 1.65–1.75 GB on this branch.--stage allprocess runs the full check. At these figures that saves about 41 CPU-minutes per run on this machine: 24 step starts × 29 CPU-s plus 66 worker starts × 27 CPU-s.load_take_up_contract, of which 56 s is the fresh derivation (45 s for the engine contract, 32 s of that building the two systems; 11 s for the remaining-stage manifest).QRF worker identity
The clean import trace in
worker_identity.pynow receives the record of the process computing the identity. So it opens the same files whether or not that process itself received a record from its parent. The monolith (_run_all), a staged run and a named--stagerun therefore compute the same identity._BOUND_ENVIRONMENT_NAMESor_WORKER_ENVIRONMENT_OVERRIDES.us_runtime/gate_shadow.py,us_runtime/multispine_pool.pyandus_runtime/us_late_overlap_ownership.py. It also imports 46 fewer standard-library modules (389 → 343), and neither policyengine-us nor torch.resolver_op), so no recorded expectation changes.Torch
python -X importtimeshowed one source of torch in a step process and a QRF worker:microcosm.calibrate.solve's module-levelimport torch(and itsfrom microcosm.calibrate.gates import HardConcrete). It is reached throughmicrocosm.build→country_spec→ledger_targets→microcosm.calibrate. Of the brief's candidates:gates.pyis loaded only throughsolve.uk_runtime/firm_generation.pyis not loaded at all by these processes, so it is left alone.The twelve
solvefunctions that use torch at run time now import it themselves, and_optimizeimportsHardConcrete. Annotations keepTYPE_CHECKINGimports.Breaking the chain anywhere else would have meant editing at least seven modules that import from
solveat module level, one of them an attested kernel source too (puf_aggregate_records).Re-pinned, on Anthony's choice to do it in this PR.
solve.pyandus_runtime/puf_qrf_chain.pyare in the source lists whose digest the spec engine's legacy-v1 seed protocol records (spec_engine/seeds.py). The protocol records the digest; it does not use it to make draws. So these move:EXPECTED_HASHES["seed_map"]and["seed_protocol"]inspec_engine/inventory_coverage.py, with a comment saying why, as earlier moves there have;docs/evidence/spec-engine/us-f0-coverage.json;spec_sha256pins intests/engine_free/shared/test_spec_engine_loader.pyandtests/engine_workflow/us/test_us_multispine_pool_tool.py.All of these were written by
tools/repin_us_spec_engine_contracts.py, run in the documented order. Its first pass wrotecovered_item_count == 40intotest_spec_engine_coverage_tool.pywhile the seed digests were still stale. A second pass restored 41, and--checkthen passes.tools/spec_engine_coverage.pyreports 42,404 of 42,404 configuration fields and 41 of 41 inventory checks.Two test pins of the solver's helper sources also move, in
pre_best_iterate/controls.jsonandtest_l2_basis.py:_apply_constraintand_relative_error_lossnow begin withimport torch. The two tests that compare the recorded pre-change optimizer with the current one still return identical bytes in all 10 cases.No other copy of an old digest remains in the repository. The
spec_sha256of the am, be, nz and uk bundles also changes, but nothing pins those.Overlap
US_TAKE_UP_PROGRAM_COUNTinengine_abi.pyandAPPROVED_UV_LOCK_SHA256inworker_identity.py. Neither line is touched here, and no lock digest or engine version is hard-coded. Move the US engine to policyengine-us 2.145.3 and prepare the Route A national build #1676 already conflicts with main in the seed-digest andspec_sha256pin files and inworker_identity.py. Whichever PR merges later re-runstools/repin_us_spec_engine_contracts.py(twice, then--check) after merging the other.claude/us-base-hash-inputs-once-b48cdb, US base: final_export records the previous checkpoint instead of writing the frame again #1737) also changetools/build_us_puf_support_base.py. This PR adds one call to_staged_subprocess_environmentand nothing else there. Both branches merged cleanly with this one ingit merge-treebefore the rebase onto main.Merging and UK builds
From review: merging this re-keys the UK solve.
calibrate.adam@1hashes all ofcalibrate.solve, and every UK solve kernel embeds its hash.uk.full.problem@1also hashescalibrate.solve.solve.py's bytes, so the next UK full build re-solves.--require-solve-reuseagainst a graph store written before the merge stops withSolveReuseError.So merge before a UK build that writes the store or after the build that reuses it, not between the two. The changelog fragment says so too.
Review
Adversarial review by independent reviewers, two per round:
Round 1 found that the base tool's QRF workers inherited only the
--stage allprocess's record. Their parent is the step process, so they ignored it and still ran the full check. Fixed inf9f4c6874, with a failing test first (56bf1eb58).Round 2 found three things:
test_stacked_worker_first_torch_import_forces_autoload_offbroke once loading the worker stopped importing torch. Rewritten indf1a6bb02.calibrategraph parity pins hashsolve.py's bytes. Re-pinned inaadceefc8.8c51b6effand re-pinned.It also found several inaccurate comments and an engine test that asserted only an exit code. Both reviewers confirmed the record path with real processes at three levels: parent, step process, and a QRF worker started by the real
run_primary_puf_qrf_chain.Review on GitHub at
5ba293efbfound nothing blocking. It raised the UK point above and answered the open items below.Round 3 found no high- or medium-severity defects and no existing test that the branch makes fail. Its three wording points are fixed in the last commit. One reviewer checked the rewritten torch test by making the launcher stop forcing
TORCH_DEVICE_BACKEND_AUTOLOAD; the test then failed, as it should.Tests
Failing tests came first in each red-green pair (
6b67ee4af,56bf1eb58,da07ae5ea). Every test was run on its own; no suite was run.New tests. All pass on the rebased branch with policyengine-us 2.2.1 installed. The engine-free files also pass in an environment without policyengine-us, as in the engine-free CI job.
packages/microcosm-build/tests/engine_free/shared/test_spec_engine_engine_abi_check_record.py(15), with a fake engine:packages/microcosm-build/tests/engine_free/us/test_us_engine_abi_lock_check_record.py(10):run_primary_puf_qrf_chainstarts (with and without a caller environment) and the launch environment receive the record;packages/microcosm-build/tests/engine_contract/us/test_us_engine_abi_lock_check_record.py(4):load_bundle("us")accepts the record (same domains digest) and does not import policyengine-us.packages/microcosm-calibrate/tests/engine_free/shared/test_solve_torch_import.py(2): importingmicrocosm.calibratedoes not import torch; a solver function imports it on first use.Existing tests whose pins or code this branch changes, run by node ID. All pass.
packages/microcosm-calibrate/tests/engine_free/shared/test_l2_basis.py::test_defaults_reproduce_the_pre_change_optimizer_bytes(7 cases) andpackages/microcosm-calibrate/tests/engine_free/shared/test_solve.py::test_best_iterate_preserves_pre_change_excluded_paths(3 cases). Both compare the recorded pre-change optimizer with the current one byte for byte.packages/microcosm-build/tests/engine_free/us/test_us_stacked_spine.py::test_stacked_worker_first_torch_import_forces_autoload_off, rewritten for the new import order, in both environments.packages/microcosm-build/tests/engine_free/shared/test_spec_engine_loader.py::test_semantic_hash_has_golden_vector_and_surface_separation.packages/microcosm-build/tests/engine_workflow/us/test_us_multispine_pool_tool.py::test_constants_adapter_equals_live_constants_and_stays_out_of_identities.packages/microcosm-graph/tests/engine_free/shared/test_graph_parity_pins.py::test_the_pinned_implementation_hash_is_the_registered_kernel_s[calibrate];packages/microcosm-graph/tests/engine_free/shared/test_graph_parity_pins.py::test_every_pinned_platform_key_is_the_one_that_platform_would_compute[calibrate];packages/microcosm-graph/tests/engine_free/shared/test_acceptance_h_parity.py::test_h1_kernel_parity.Checks. These all pass:
tools/repin_us_spec_engine_contracts.py --check;tools/spec_engine_coverage.py(42,404 of 42,404 configuration fields, 41 of 41 inventory checks);python3 tools/ci_test_plan.py verify;ruff checkandruff format --checkon every changed file.Not run: the base bit-equivalence test.
packages/microcosm-build/tests/engine_workflow/us/test_us_puf_support_base_equivalence.py::test_monolith_and_staged_builds_are_bit_exact_at_every_boundaryneeds CPS 2022–24,puf_2024.h5and ACS 2022 inputs. None of them is on the Mac this was built on. The data-placement ruling indocs/us-modal-stage-runbook.mdallows the PUF only on thepolicyengineModal volumes. Anthony pre-approved this test at reduced size (5,000 households). Running it would have needed either the inputs here or a Modal run. On the review's reasoning (under "Open"), Anthony decided on 2026-11-26 to skip it for this change.Open
_LockCheckInputssays so. Review found this enough: on Modal the image fixes both packages, and the lock's engine entry names policyengine-us alone.random, which importing policyengine-us made (inrich.style).Review found no base step that depends on any of these. The only microcosm code that uses the global
random, the QRF's leaf shuffle, seeds it first.tools/modal_us_stage_plan.pylets a plan setMICROCOSM_*variables, and the runner does not removeMICROCOSM_ENGINE_ABI_LOCK_CHECK_RECORDfrom a container's environment. It does refuse and removeMICROCOSM_TELEMETRY_PARENT_PID. A plan that set a well-formed record whose issuer ID equals the tool's parent process ID in the container would let--stage allskip deriving the lock. That needs someone to set it on purpose. Refusing the name there, as is done for the telemetry variable, would close it. Review agreed this can be a follow-up.🤖 Generated with Claude Code