Repository navigation
Choose transition rules for supplied AR1 nodes - #626
Conversation
Documentation build overview
38 files changed ·
|
mj023
left a comment
There was a problem hiding this comment.
Again, no big errors that would have any impact on model execution etc. But I found some minor things that should be fixed and some cleanups that could be done before merging.
1. DensityDerivativeAccuracyError docstring promises a guard that doesn't run (src/lcm/exceptions.py:225)
The docstring says an out-of-budget derivative is rejected and that "under JIT the runtime callback reports this error". Routine AD never runs the certificate. For the row your own rejection test uses (family="central", rho), _certify_density_derivative_row raises, but jax.jit(jax.jacfwd(...)) returns 0 for the middle component instead of the reference -1.85e239, without any error. The case is extreme, but a public docstring shouldn't promise error control that doesn't exist. Could it be reworded to match the user guide, so it says the error comes only from the explicit developer certificate?
2. Test-only certificate is shipped and imported with the library (src/_lcm/processes/ar1.py:35)
density_derivative_admission.py (about 630 lines) is loaded on every import lcm, but only the private _certify_density_derivative_row oracle uses it. Since it doesn't run in solve, simulate or AD, could it live under tests/ next to test_density_derivative_accuracy.py, or at least be imported lazily inside the certify function? Then the public exception could move with it.
3. Unrelated CI change (.github/workflows/benchmark-pr.yml)
cancel-in-progress: false means a new push no longer cancels a running GPU benchmark for an outdated commit. That isn't mentioned in the description and seems unrelated to on_nodes. Was it intentional?
Cleanup
_checked_density_coefficientsstill carries theio_callbackexemption and docstring, but nothing registers it as a callback; calling_certify_density_coefficientsdirectly would remove the wrapper.- The user guide tells readers to call the private
_lcm.processes.ar1._certify_density_derivative_row; that part could go in developer docs or just point at the test file. _get_conditioned_weights_funcreadsfixed["rho"]in the new branch, thoughrho_fixedis already bound a few lines above.- The "Unknown on_nodes transition_rule" check can't fire, because beartype rejects a wrong
Literalfirst, and a singleTransitionRulealias would replace the four copies of thatLiteral.
|
Thanks, all addressed:
Cleanups:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
read_nbegm_resources_bank refused any resources outside the range the solve's wealth grid times quadrature nodes spans. Fresh period-0 draws beyond the nodes landed there, and simulate refused with "unresolved row integrity" although the Euler row extrapolates to the exact solution. The support bound was a domain check, not a semantic one; the finite, positivity and savings-bound checks stay. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
close_prepared_case_r_parent_demands re-traced the whole native kernel only to confirm that attaching parent demands left the frozen output schema unchanged. Lowering already asserts the output roles on every compiled core, so the second trace was a redundant audit: 2.5-4 s of params validation on the Case-R toy, outputs unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
GridSearch now admits literal and callable floors with shocks=, the bound evaluated per node against the realized draw as on the node-state route; DCEGM/NBEGM admit the literal floor at the savings-grid origin, which is aca's only EGM constraint. Callable floors under EGM and query reconstruction stay refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Arrival queries evaluated a landing process state at its node position instead of its value (23.34 vs 5.077 on the collective toy; 11 vs 10 on a Tauchen AR(1)), which also crashed z_code reads. Arrivals now price a target's value-dependent constraint from the transported same-period values, root their predicates and projections against pruning, get the gated-edge projection-coverage check, clip or raise on off-grid fallbacks, refuse off-node process codes, and validate read keys as parameter-path segments. Runtime-parameterised process landings in an arrival target are refused at build instead of silently mispriced. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Certificate conflicts were digest-only; kept HEAD, then re-anchored with repin_corridors.py and check_seals.py --fix. Registered the two new test files in ci-workloads.json on top of HEAD's manifest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Strip the three deleted gate test files from ci-workloads.json and re-derive the shards; drop the two of them that the collective surface census listed as engine-level modules. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
The ledger described the removed inverse-marginal-utility scope gate in _redecide_branch_and_read_policy; the read is gone, so the row goes. FUES now enables the policy read, so the solve compiles the replay program in place of main; the compiler-option test asserts that layout and that the option reaches the program actually compiled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Step 1 published a simulation policy for every plain DCEGM regime, and lookup_policy refused any regime with one. It now calls simulate's own policy-first read and falls back to the grid decision only for rejected rows. The reader is one jitted program with the period traced, so periods sharing a kernel share a compile: Iskhakov 10k cold simulate 6.0 s -> 5.1 s, warm 0.19 s, means unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Also folds in the s12fix follow-ups, since only merge commits are made here: - s12g2-xfail-flips.patch: the six arrival strict xfails become plain tests; the `dissolution_fallbacks` xfail stays. - migration-fixups.patch: s12fix's arrival migrations of the pruning-roots, projection-coverage, simulate-guards, produced-values and route-scheduling tests replace the g1 versions where they overlap, dropping the state-only Gate stand-ins the arrival path now supports. - test_process_code_binding: an arrival landing in a runtime-parameterised process is refused at build; a state-only Gate that does not read the process keeps it supported, pinning the scope of the Gate's refusal. - Strip the deleted test_dissolution_flag_retention.py from ci-workloads.json, drop a helper whose only user was deleted, and remove the two modules that now reach `Model` from the collective surface census's engine-level set. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Their oracles are the parent's argmax over the declared consumption grid, which put the child on its corner. Since step 1 the plain DCEGM parent simulates policy-first and picks the continuous optimum (value 1.524 vs 0.832 for the grid choice), so the tests now opt into the existing replay="grid" route to keep their oracle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Nested EGM replay emits the read's winner and scores canonical Q once on it instead of rescoring the whole bank against a grid baseline; finite NNBEGM ranks the bank by published value, keeps the semantic feasibility mask over the bank, and loses the dropped-candidate audit and its host sync; Case-R/U status is one device-side code read once per regime-period. Finite NNBEGM toy cold simulate 4.5 s -> 1.6 s. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
The lookup lane moved canonical-Q evaluation into the compiled reader, which reaches `_evaluate_canonical_Q_at_actions` through the regime's `Q_and_F` slot; the stub test patched the old outer seam and its stub regime lacked the slot. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
…hort The module fixture simulated four periods from a cohort of singles, which compiles the exit and participation-entry simulation programs for two landings. Cold, that fixture alone took about nine minutes and 7.8 GB on CPU, past the 600 s per-test timeout under xdist. Starting half the cohort married lets three periods carry a marriage and a dissolution in one landing, and the dissolution test now names the period and both single regimes it lands in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
…et-validation Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
JAX 0.12.0.1 and NumPy 2.5.4 change dependency-bound model identities and compiled workspace reservations. Re-pin all seven models at both precisions. Fresh probes confirm that execution-policy changes leave those identities unchanged. Use the measured 33,884-byte bracket: the period-1 width-2 pair needs 33,820 bytes, the period-0 width-2 pair needs 33,948, and width 1 needs 27,212. The existing paired-admission checks retain their fit/refuse behavior. Adopt the two dependency witnesses from 0bb9b170c and 5d826116c after independent checks against the numerical-repair source e56d64f. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
Use the approved one-ULP bound for broadcast, fixed-component and FUES floating outputs compiled with different execution shapes. Keep array metadata, nonfinite patterns, integer counts and simulated discrete outcomes exact. Engine arithmetic and other numerical gates are unchanged. Both CPU precisions execute all 159 selected cases without failure. Positive and negative controls exercise the bound and exactness checks.
The replay worker dies 600 seconds after starting in the shared CPU CI shard. The unchanged covered case passes in a fresh process. Deselect it from the parallel shard and run it alone afterward, retaining its full fixture, exact frame comparison and 600-second timeout. Append its coverage to the owning shard report and mark it fresh for the policy launcher. Record both precision invocations in the workload manifest. All 775 CI contract cases pass. Real collection proves disjoint unions of 1040+1 and 640+1 cases, matching the original CI inventories without losses. A real coverage check confirms append preserves prior coverage and its negative control loses it. Actual GitHub CI remains required after push.
A correctness update must not discard the benchmark measurements already running for review. Match the main benchmark policy: finish the active run and queue the latest revision in the existing concurrency group. Runners, GPU locking, measurement commands and timeouts are unchanged. The regression reproduces the cancelling PR policy against the existing non-cancelling main policy. All 777 CI-contract cases and all-file Prek pass. Verify actual old-run preservation and the new queue after push.
Keep benchmark-pr cancel-in-progress true within its existing branch group, and keep benchmark-main false. Correct the regression contract to check the two intended policies instead of requiring both to retain runs. The published false PR policy fails the corrected contract. The local correction passes all 777 CI-contract cases and all-file Prek. Hold this commit locally for the next fixes batch, as requested.
Keep the 1,000-subject measurements active and skip all four 100,000-subject measurements before setup. Track the deferred performance repair in #638.
…codex/cascade-pr625-20261103 # Conflicts: # tests/candidate_certificate/direct_flow.py # tests/candidate_certificate/sources.json
…20261103 # Conflicts: # tests/candidate_certificate/direct_flow.py # tests/candidate_certificate/sources.json # tests/ci/ci-workloads.json
Benchmark comparison (main → HEAD)Comparing
|
Publish original current shocks separately from the final actor realization, including participation fallback observations. Keep simulation inputs and draws unchanged, retain discrete report codes, and report the stored coordinates for missing values.
Models using supplied AR(1) state nodes can choose how transition probabilities are computed through
TauchenAR1Process.on_nodes:Quadrature accepts a Gauss–Hermite node count or explicit standardized nodes and weights. Targets outside the state grid are clipped to its endpoints. Parameters and innovation scales can vary at runtime or with the current state.
Node-based simulation uses the selected transition matrix. Continuous simulation keeps its conditional normal draws.
The implementation also stabilizes density calculations and quadrature allocation over extreme numerical ranges. Targeted CPU and A100 tests cover transition probabilities, derivatives, Bellman expectations and simulation.
Density-rule derivatives use normalized scaled arithmetic. The stronger finite-row accuracy certificate is retained in private
_lcmas a deliberately invoked developer/test oracle. It is documented with its input scope and success-or-rejection guarantee; it does not run during routine differentiation, solving or simulation at eitherruntime_checkssetting. Routine derivatives do not carry that certificate's componentwise accuracy guarantee. The usual probability and finiteness checks remain controlled byruntime_checks.Density stabilization adds compilation and memory cost in the measured small-model workload; this is not a performance estimate for every model.
Stacked on #625. Closes #586.
Validation: CPU CI · GPU CI.