Skip to content

Honor finite floors in paired maximum reductions - #630

Open
hmgaudecker wants to merge 40 commits into
codex/583-subnormal-livenessfrom
codex/570-singleton-initial
Open

hmgaudecker wants to merge 40 commits into
codex/583-subnormal-livenessfrom
codex/570-singleton-initial

Conversation

@hmgaudecker

@hmgaudecker hmgaudecker commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

A finite initial could be ignored when an action axis contained one element, returning the action value even when it was below the floor. The paired maximum now reduces with the dtype identity and compares the result with the requested floor afterward.

Floating values stay encoded as integers during the paired reduction and floor comparison. This preserves subnormal ordering, the winning action ID, signed-zero ties, masking, and the existing maximum derivative convention.

Validation: exact-bit value and action-ID regressions, analytic gradient checks, full argmax and hard-maximum tests, zero-mass continuation checks, and combined continuation/probability tests passed at both precisions on Marvin. Normal lint/type/lock/source-certificate checks and certificate mutation controls passed.

The broader oracle module retains separate baseline failures when explicit precision contexts are mixed; this change does not claim to repair that behavior.

Based on #629. Closes #570.

@hmgaudecker hmgaudecker linked an issue Oct 26, 2026 that may be closed by this pull request
@read-the-docs-community

read-the-docs-community Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

@hmgaudecker
hmgaudecker marked this pull request as ready for review October 26, 2026 14:37
mj023 added a commit that referenced this pull request Nov 1, 2026
The base removed the solve-time dissolution flag and its artifact key, the
current-IID replay inputs and the projected-forward inputs of the chunk
planner, and added participation surfaces to the result and its archive.
Value storage follows: no flag is copied to the host, published, read early
or reserved; the read declarations and the early load cover values and
policies; the period-by-period simulation passes the chunks the base's new
participation surfaces and node-axis inputs; and the streamed archive writes
participation surfaces at completion, as a save does. Certificate pins and
seals rebuilt on the base; CI manifest regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…codex/cascade-evening-20261101-pr625

# Conflicts:
#	tests/candidate_certificate/direct_flow.py
#	tests/candidate_certificate/sources.json
…e-evening-20261101-pr626

# Conflicts:
#	src/_lcm/processes/ar1.py
#	tests/candidate_certificate/direct_flow.py
#	tests/candidate_certificate/sources.json
…e-evening-20261101-pr628

# Conflicts:
#	tests/candidate_certificate/direct_flow.py
#	tests/candidate_certificate/sources.json
…e-evening-20261101-pr629

# Conflicts:
#	tests/candidate_certificate/direct_flow.py
#	tests/candidate_certificate/sources.json
…e-evening-20261101-pr630

# Conflicts:
#	tests/candidate_certificate/direct_flow.py
#	tests/candidate_certificate/sources.json
hmgaudecker and others added 4 commits November 1, 2026 18:41
A simulated process value beyond its nodes extrapolates the edge transition
rows linearly, so a row can carry a negative coefficient while still summing
to one. Since 9462d19 the scaled mean poisoned such rows with NaN, so every
off-grid Rouwenhorst subject got a NaN value and the lowest consumption node.
Rows with a negative coefficient now take the signed scaled reduction they
used before; all other rows keep the scaled mean. Both branches see
placeholder inputs on the rows they do not serve, so neither sends NaN into a
derivative.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
…initial

# Conflicts:
#	tests/candidate_certificate/direct_flow.py
#	tests/candidate_certificate/sources.json
…initial

# Conflicts:
#	tests/candidate_certificate/sources.json
mj023 added a commit that referenced this pull request Nov 2, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
hmgaudecker and others added 10 commits November 2, 2026 20:25
…initial

# Conflicts:
#	tests/candidate_certificate/sources.json
Process transition rows beyond the outer nodes are now genuine lotteries: the
Tauchen family reads its law's row at the current value, and Rouwenhorst
extends the continuation from its edge rows. No row with a negative
coefficient reaches the scaled average any more, so a negative weight again
poisons its row. The Rouwenhorst off-grid simulation test stays.

This reverts the source and zero-safe test changes of commit 6bfe964.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K77bhreFhbLuuKA6zCbv8t
The block-major values are byte-for-byte equal to the period-major blocked
solve; the unblocked route is only promised agreement within eight ULP.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Hs8mfXPYyEa24KaAp6BwCW
…20261103

# Conflicts:
#	tests/candidate_certificate/sources.json
@codecov

codecov Bot commented Nov 4, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.15498% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.11%. Comparing base (fc033b7) to head (f9c0c16).

Files with missing lines Patch % Lines
src/_lcm/regime_building/argmax.py 91.30% 4 Missing ⚠️
tests/test_distributed.py 96.96% 1 Missing ⚠️
Additional details and impacted files
@@                      Coverage Diff                       @@
##           codex/583-subnormal-liveness     #630    +/-   ##
==============================================================
  Coverage                         94.10%   94.11%            
==============================================================
  Files                               660      660            
  Lines                            110606   110856   +250     
==============================================================
+ Hits                             104089   104334   +245     
- Misses                             6517     6522     +5     
Flag Coverage Δ
cpu-python 94.11% <98.15%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

mj023 added a commit that referenced this pull request Nov 4, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 5, 2026

Copy link
Copy Markdown

Benchmark comparison (main → HEAD)

Comparing c8430c80 (main) → f9c0c164 (HEAD)

Benchmark Statistic before after Ratio Alert
ACA (reduced) warm solve + simulate (reuses compiled code) 43.816 s 259.917 s 5.93 ❌
cold solve + simulate (first run, includes compilation) 791.91 s 1900.01 s 2.40 ❌
peak CPU mem 7.54 GB 11.75 GB 1.56 ❌
Mahler-Yum warm solve + simulate (reuses compiled code) 5.853 s 7.249 s 1.24 ❌
cold solve + simulate (first run, includes compilation) 18.37 s 28.04 s 1.53 ❌
peak CPU mem 1.69 GB 1.78 GB 1.06
peak GPU mem: automatic solve + simulate 1.61 GB 496 MB 0.31
peak GPU mem: load saved solution + simulate 1.89 GB 837 MB 0.44
peak GPU mem: solve + save all persistable artifacts 571 MB 571 MB 1.00
Precautionary Savings - Solve execution time 259.9 ms 83.5 ms 0.32
first call (including compilation) 1.55 s 1.70 s 1.10
peak CPU mem 1.44 GB 1.45 GB 1.01
Precautionary Savings - Simulate execution time 900.0 ms 899.5 ms 1.00
peak GPU mem 324 MB 640 MB 1.98 ❌
first call (including compilation) 2.91 s 3.97 s 1.36 ❌
peak CPU mem 1.59 GB 1.58 GB 0.99
Precautionary Savings - Solve & Simulate execution time 866.3 ms 741.6 ms 0.86
peak GPU mem 1.50 GB 3.74 GB 2.49 ❌
first call (including compilation) 4.07 s 5.27 s 1.29 ❌
peak CPU mem 1.54 GB 1.54 GB 1.00
Precautionary Savings - Solve & Simulate (irreg) execution time 997.5 ms 886.9 ms 0.89
peak GPU mem 2.20 GB 3.74 GB 1.70 ❌
first call (including compilation) 4.20 s 5.59 s 1.33 ❌
peak CPU mem 1.54 GB 1.55 GB 1.00
Iskhakov et al. (2017) - GridSearch Solve execution time 363.4 ms 187.4 ms 0.52
peak GPU mem 120 MB 120 MB 1.00
first call (including compilation) 2.81 s 2.66 s 0.95
peak CPU mem 1.57 GB 1.63 GB 1.04
Iskhakov et al. (2017) - DC-EGM Solve execution time 651.1 ms 814.6 ms 1.25 ❌
first call (including compilation) 6.13 s 6.83 s 1.11 ❌
peak CPU mem 1.85 GB 1.98 GB 1.07
Iskhakov et al. (2017) - GridSearch Simulate execution time 1.011 s 918.8 ms 0.91
peak GPU mem 892 MB 890 MB 1.00
first call (including compilation) 6.54 s 7.13 s 1.09
peak CPU mem 1.70 GB 1.77 GB 1.04
Iskhakov et al. (2017) - DC-EGM Simulate execution time 1.115 s 1.270 s 1.14 ❌
peak GPU mem 891 MB 891 MB 1.00
first call (including compilation) 6.84 s 9.57 s 1.40 ❌
peak CPU mem 1.92 GB 2.04 GB 1.07
Collective Household - Construct execution time 735.8 ms 1.497 s 2.03 ❌
peak CPU mem 1.40 GB 1.43 GB 1.02
Collective Household - Solve execution time 481.2 ms 5.347 s 11.11 ❌
first call (including compilation) 2.88 s 44.87 s 15.57 ❌
peak CPU mem 1.46 GB 2.77 GB 1.90 ❌
Collective Household - Simulate (1000) execution time 1.189 s 37.917 s 31.89 ❌
first call (including compilation) 14.59 s 591.79 s 40.56 ❌
peak CPU mem 1.48 GB 31.50 GB 21.28 ❌
Collective Household - Simulate (100000) execution time 1.220 s nan µs nan
peak GPU mem 189 MB nan MB nan
first call (including compilation) 15.33 s nan s nan
peak CPU mem 1.56 GB nan MB nan
Reference Chain - Solve (1) execution time 217.7 ms 39.9 ms 0.18
first call (including compilation) 1.76 s 1.75 s 0.99
peak CPU mem 1.12 GB 1.19 GB 1.06
Reference Chain - Solve (8) execution time 492.7 ms 259.5 ms 0.53
first call (including compilation) 5.80 s 6.51 s 1.12 ❌
peak CPU mem 1.23 GB 1.31 GB 1.07
SimulationDispatch ('dissolution', 'off') warm simulation time per period and regime (ms) 45.77 ms 74.67 ms 1.63 ❌
backend compile requests on second simulation call 0
SimulationDispatch ('dissolution', 'progress') warm simulation time per period and regime (ms) 44.76 ms 78.89 ms 1.76 ❌
backend compile requests on second simulation call 0
SimulationDispatch ('multi_regime', 'off') warm simulation time per period and regime (ms) 49.92 ms 51.83 ms 1.04
backend compile requests on second simulation call 0
SimulationDispatch ('multi_regime', 'progress') warm simulation time per period and regime (ms) 48.43 ms 51.53 ms 1.06
backend compile requests on second simulation call 0

This branch has not been deployed

No deployments
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.

argmax_and_max: restrict initial to None or -inf

1 participant