Repository navigation
Conversation
Balances are stored as float32, so three accounts that add to exactly a limit in cents can sum a fraction of a cent above it (178.57 + 1,547.79 + 273.64 = 2,000.0001) and fail an "at or below" test, or below it and pass a "below" test. Add a shared round_to_cents helper and apply it where SSI, SNAP, Medicaid, the Medicare Savings Programs, BBCE and 47 state programs compare summed resources with a dollar limit. Each site has a YAML witness at the limit that fails on main, and a cent-over (or cent-under) case. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LwQq6HXUrFaqEeR9DeqWcq
…ically needy witness to Hawaii The Arkansas case counted the unit as an SSI recipient, which bars the medically needy pathway, so it couldn't show the asset boundary. Hawaii has the same 2,000 limit and reaches it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LwQq6HXUrFaqEeR9DeqWcq
snap_assets sums person inputs to the SPM unit in float64 before storing float32, so the Idaho witness needs a split that drifts on that path too. Hypothesis favours edge splits that never drift; pinned examples make the model property fail without the rounding. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LwQq6HXUrFaqEeR9DeqWcq
|
Ready for hub review Head: What the item asked, and how it's resolved
Witnesses (hand computation)
Each state file has a comment above its case giving the split and the total. Tests runAll YAML runs were one file per process; Python tests ran with pytest, one file per process.
MutantsEach ran in its own process, and the code was restored afterwards.
Cost of the new Python testMeasured locally on this 4 vCPU VM (not Linux CI): 2 tests in 12-19 s; the whole process took 67 s with startup; peak RSS 1.2 GiB. It was measured before the pinned example was added, which adds one simulation. The file lands in the CIThe PR is a draft, so CI hasn't run. Judgment calls
Proposed follow-ups
Generated by Claude Code |
|
Hub review in progress Head reviewed: Findings so far (not final):
Still running: the head and main YAML runs, mutants, and the property test. Generated by Claude Code |
|
Ready for hub review The head hasn't moved past METHODOLOGY_CHOICE is FindingsP2-1. SSI parental deeming: rounding absorbs a real third-of-a-cent share, not float noise
Witness: in 2026-01, a parent (not ABD) has a $2,100 bank account, giving $100 of excess. Three ABD children each hold $1,966.67 in a single account, so no float32 sum is involved. Each child's share is $33.3333. Counting the share to the cent may well be right, since SSA works in cents. But it is a rule about how a share is counted, not a float artefact. Either cite a source for counting the share to the cent, state the choice in the body, and pin it with a YAML case like the one above, or limit this site's rounding to the float32 sums it was meant for. Also replace the axiom line, for example: P2-2. MD PAA and VA AG still flip, and each witness takes three inputsThe body lists I held every other input fixed and compared $2,000 in one account with 178.57 + 1,547.79 + 273.64, using a Python Fix: P2-3. Income tests weren't swept, though the brief asked for themThe brief's item 1 asks to sweep " P3-1. The exactness bound is twice as wide as statedThe test comment ( Measured on the model at this head, with 3,000 random three-way cent splits per total in Fixed sites with limits above $32,768: MSP and medically needy in CA ($130,000 / $195,000) and medically needy in NY ($33,038 / $44,796). Above $65,536, float32 can't hold cents at all. In 100,000 three-way splits per case, rounding never put a result on the wrong side where main got it right, but at $130,000 about 5% of exact-limit splits stay wrong on both. The body's "rounding helps there but doesn't guarantee exactness" is accurate. Suggested comment text: P3-2. Open #10141 overlaps six files#10141 touches P3-3. The model property mostly repeats the YAML witnesses
Local cost on this VM (not Linux CI): the file took 85 s wall including startup and P3-4. Small items
Checked and sound
What I couldn't check
Generated by Claude Code |
|
Picking this up for the US hub. I'll post a hand-off comment here when it's ready. Generated by Claude Code |
Bring the branch up to date with main before this review round. The merge had no conflicts; main's nine commits touch none of this PR's files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rounding own resources plus the share to cents turned a child's true 2,000.0033 into 2,000.00 and passed them, though main fails them. That is a rule about how a share counts, not float noise. POMS SI 01330.200 B says to equally divide the deemed resources among the children, and 20 CFR 416.1202(b)(1) sets no rounding rule, so the share now stays unrounded. The rounding stays on the sums of float32 balances the comparisons reach: the deemors' total before the parental limit comes off, a child's own balances, a couple's balances on a joint claim, and a person's own plus an ineligible spouse's. New YAML pins the review's three-child witness (all fail, as on main), a whole-cent share at the limit that main fails, a cent-over companion for the deemed-parent case, and at-limit and cent-over pairs for the spousal and joint paths. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both compare ssi_countable_resources, a float32 sum of bank, stock and bond balances, with the $2,000 SSI limit, so three balances that add to exactly $2,000.00 failed as $2,000.0001. Each fix gets an at-limit case and a cent-over companion. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Below 2**15 dollars a float32 half unit is at most 2**-10, so five half units stay under half a cent: the helper's guarantee holds below $32,768, not $16,384, and the property now draws totals up to $32,767.99. The model property built a Simulation per example, and only its pinned example caught anything; the YAML at-limit cases cover that, so it goes. Also remove a stray blank line in the Pennsylvania TANF formula. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rounding own resources plus the share inside the loop alone keeps the review's three-child witness unchanged, since all three children stay or leave together. This case lets one child leave the division on the exact share, so the other two divide the excess as 50 each; rounding the loop's total would keep all three at 33.33. Main gives the same result as this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Both add a parental share to a child's resources and then rounded the total to cents, which absorbed a fraction-of-a-cent share the same way the SSI test did. Medically needy adds SSI's own share; Iowa divides the excess as SSI does. Round only the summed balances and add the share unrounded, as the SSI resource test now does. The medically needy witness is a disabled child whose own income is too high for SSI, so they don't count in the division but are deemed the share their SSI-eligible siblings divide: 1,966.67 plus 33.3333 fails, as on main, and a whole-cent share at the limit passes, which main fails. Iowa's computed share doesn't give that witness: a child whom the share takes over the limit leaves the division and is deemed the remaining children's larger share, or the whole excess if none remain. So its witness enters a certified share. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Keeping the parental share unrounded left two float errors that decide totals at the limit. Float64 addition put 1,983.90 + 48.30 / 3 at 2,000.0000000000002, which removed an at-limit child from the division and raised the siblings' shares. And core stores the share as float32: a share of 100.01 reads back as 100.010002, so a child with 1,899.99 failed a $2,000 limit that main and the previous head passed. The deeming loops now test divisor x own + excess <= divisor x limit in whole cents, and store each share as the largest float32 at or below it, so own resources plus the share read back stay within any limit the exact total meets. The share is still never rounded to cents. Iowa's loop also rounds the deemors' total and the child's own balances, which it summed in float32 without rounding. New cases: a whole-cent share at the limit (SSI, medically needy and Iowa), 16.10 shares that keep an at-limit child in the division (SSI and Iowa), a parent's three-account split at the Iowa allowance, and an Iowa child whose three accounts plus the share total the limit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The whole-cent comparison converts own resources to cents itself, so no test caught dropping the loop's own-resource rounding. The loop still needs it to decide which children are deemed at all: a child whose balances total exactly $2,000 would add to 2,000.0001, be left out of the deeming, and pass on their own resources. This case expects the child to be deemed the parent's 100 of excess and fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Picking this up for the US hub, continuing an earlier session's work on this fix round (its commits Generated by Claude Code |
Bring the branch up to date with main before this fix round. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Picking this up for the US hub, continuing an earlier session's work on this fix round (its commits through Generated by Claude Code |
|
Ready for hub review This round continues an earlier session's work. Its nine commits ( Findings
MutantsEach ran in its own worktree and process and was restored afterwards (
TestsAll runs at the final tree, one file per process:
The same seven changed YAML files were also run against two other trees:
No full suites or microsimulations were run. CIThe Pull request run 41709965715 at Judgment calls
Proposed follow-up
Generated by Claude Code |
|
Hub review in progress Head under review: These findings may still change:
Still running: the head's YAML files, main comparisons, mutants and overlaps. Generated by Claude Code |
|
Ready for hub review The head hasn't moved past All seven round 1 findings are fixed, and the run that covers each is below. The P2-1 design that goes past the brief's literal text is the right one. Each child's share stays an exact equal division, and against exact rational arithmetic the kept code never puts a child on the wrong side of the limit. The brief's literal variant would have regressed against main. METHODOLOGY_CHOICE is FindingsP3-1. The overlap list misses #10629, which conflicts with this head and not with main
Open #10629 ("Let Missouri aged, blind and disabled people who don't receive SSI spend down", head as fetched today) rewrites the line this PR changes to The fix is in the body only. Add to "Overlapping open PRs": The body's other overlap claims hold. Rechecked at each current head:
P3-2. The float64 example in the docstring and two YAML comments is false as written
All four say The drift is real, but it comes from forming the excess as Round 1 findings at this head
The judgment call past the brief (P2-1)The rule under 20 CFR 416.1202(b)(1) and SI 01330.200 B, as the hub quoted them, is: the child's own resources plus an exact equal share of the parental excess, against the $2,000 individual limit. I computed each variant against that rule with exact integer arithmetic (
So the kept version moves no child across the limit in either direction relative to the exact rule. Where it differs from main, main was wrong, and only in main's loop. The literal variant wrongly fails about 11% of at-limit children whom main passes. The YAML cases agree. I reran both variants in their own processes:
The MutantsEach ran on its own copy of the head, one YAML file per process, and was then deleted.
Checked and sound
What I couldn't check
Generated by Claude Code |
1,983.90 + 48.30 / 3 is exactly 2,000.0 in float64. The drift comes from forming the excess as 2,048.30 - 2,000, which gives 48.30000000000018; 1,983.90 plus a third of that gives 2,000.0000000000002. Comments only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR Review: Round summed resources to whole cents before exact-limit asset testsSummaryThe model stores balances as float32, so three cent amounts that add to exactly a whole-dollar limit can sum a fraction of a cent above it (failing a The core design is sound. Rounding touches only sums of whole-cent inputs, and the child's share of parental excess is never rounded to cents. I confirmed the at-limit witnesses with float32 arithmetic on the summing path each site uses. CI is 36/36 green at the head. One should-address item remains. The PR body's site inventory, which says why each unchanged site was left alone, omits the California county general relief and general assistance asset tests. These have the same drift, with witnesses at their limits, and stay unrounded. The other notes are suggestions. Critical (must fix)None. Should address1. The body's site inventory omits the California county general relief and general assistance asset tests, which drift the same way and stay unrounded. The body sorts every site into "Sites fixed" and "Sites left unchanged (no witness)". The only local programs it names are San Bernardino and San Francisco, under "Not probed". These county tests compare a float32 sum of whole-cent balances with a whole-dollar limit and are neither rounded nor listed:
Witnesses use the float64-sum-stored-as-float32 path that
Several sum-based tests in the same family have multi-person witnesses (two people's float32 balances summed): Alameda and Los Angeles personal property, Marin personal property, and San Mateo property (strict Fix: either apply Suggestions
Verified correctRounding never changes a legal result.
Exactness bound.
The share stays an exact equal division (POMS SI 01330.200 B; 20 CFR 416.1202(b)(1)).
Helper placement and vectorization.
Boundary pinning. Each of the 59 changed variable files except the pure refactor has a variable-named YAML file with an at-limit case and a cent-over or cent-under companion (58 files;
Hand-checked expectations.
Other checks.
Axiom line assessment
The CI statusAll 36 checks pass on run 41733711974 at head Branch status
Verdict: REQUEST_CHANGES |
DTrim99
left a comment
There was a problem hiding this comment.
Requesting changes per the review above: 0 critical, 1 should (California county GR/GA asset tests drift the same way but are neither rounded nor listed in the body's inventory), 4 suggestions.
Restore Orange County's aggregate vehicle exemption and honor reported zero equity. Apply Colorado's strict resource cap and stop income deeming after legal separation. Preserve fractional SSI limits and cover float32 drift in SNAP and SSI totals. Co-Authored-By: GPT-6.2 Sol <noreply@openai.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DTrim99
left a comment
There was a problem hiding this comment.
Program review
Base repository: PolicyEngine/policyengine-us
PR number: 10639
Reviewed head SHA: 20d68c2
Merge base SHA: 094934a
Mode: incremental from 122d8fd
Scope: changed behavior and affected dependencies
Source manifest: /private/tmp/policyengine-command-runs/ea33c0bb2b64/pr-10639-review-sources.json
Review status: COMPLETE
Source Documents
- oc-gr-sec60.pdf — cached original.
- co-9ccr2503-5.pdf — cached original.
- idapa-160304.pdf — cached original.
- ecfr-416-1205.xml — cached original.
Critical
C1 — Colorado OAP applies "below the resource limit" only to married and legally separated clients (OPEN)
- Location:
policyengine_us/variables/gov/states/co/ssa/oap/co_oap_eligible.py:32-33(where(married | couple_separated, assets < asset_limit, assets <= asset_limit)). Tests atpolicyengine_us/tests/policy/baseline/gov/states/co/ssa/oap/co_oap_eligible.yaml:52("Three accounts that total exactly the resource limit pass", 2025) and:31("Eligible single", 2023, from main). - Trigger: a Colorado client who has never married, is widowed or is divorced, age 60 or older, with countable resources of exactly $2,000. For example, 1,157.81 + 285.17 + 557.02 in 2025.
- Observed:
co_oap_eligibleis true. CI runs this as a passing assertion. A legally separated client at the same $2,000 unmarried limit is false (:216, "Legally separated applicant at the strict unmarried limit fails"). A married couple at $3,000 is false (:41). - Expected: false. 9 CCR 2503-5 3.520.71(A)(1) (physical PDF p. 32) says the client shall "Have countable resources below the resource limit as outlined in Section 3.520.72". The definitions (p. 3) say: "'Eligible client' means a client whose countable resources are below the resource limit". Neither text distinguishes marital status. 3.520.72(A)(1)(a) (p. 35) sets one $2,000 limit for "an unmarried client", and 3.520.63(D) (p. 27) treats legally separated clients as unmarried. So never-married and legally separated clients share the same limit and the same strict test. The head's own comment at line 31 cites 3.520.71(A)(1) for the strict test, then applies it only to the married and separated branch.
- Why this diff: commits 8ef4272 and 871d058 rewrote this comparison and made the strict rule depend on marital status. The PR's rounding also flips the three-account $2,000 split from ineligible at main (float32 total 2,000.0001221) to eligible, and the new at-limit case pins that result. The same
<=for a clean $2,000 single input ("Eligible single") already exists on main. - Impact: an unmarried Colorado OAP applicant at exactly $2,000 gets eligibility and the full OAP grant that the rule denies. The population is small but the household effect is all-or-nothing.
- Fix: use
assets < asset_limitfor every client. Flip the expectations at:31and:52to false. The one-cent-below case at:110already pins the passing side. Update the changelog's "strict resource limit for married and legally separated applicants" wording. - Source: /tmp/policyengine-command-runs/ea33c0bb2b64/sources-10639/co-9ccr2503-5.pdf (ruleVersionId=10694, the version the parameters cite, last amended 03/02/2023 per its history notes). A later rule version was not checked. The cited version governs the parameter.
- Proposed severity: This is an executed wrong eligibility result in a claimed year (2025 and 2026), and this diff introduces and pins it at the PR's at-limit witness.
Coordinator assessment: I've kept this critical. It is an executed wrong eligibility result in 2025 and 2026: an unmarried applicant at exactly $2,000 gets the full OAP grant that 9 CCR 2503-5 3.520.71(A)(1) denies ("countable resources below the resource limit"). The new at-limit case pins it, after this round's rounding flips the three-account $2,000 split from ineligible on main to eligible. The code review raised the same comparison for the policy role. The fix is one operator, assets < asset_limit for every client, plus flipping the expectations at lines 31 and 52.
Should Address
A1 — PR-caused red CI: the new Orange County input breaks the pre-first-modeled-year uprating test (OPEN)
- Location:
policyengine_us/variables/gov/local/ca/oc/general_relief/resources/ca_oc_general_relief_exempt_vehicle_equity.py(added in 8ef4272). It meetspolicyengine_us/tests/core/test_pre_first_modeled_year_uprated_inputs.py:62-70(_situation). - Trigger:
add_default_uprating(tools/default_uprating.py:125) gives any float USD input the AGI-per-capita uprating. The new input hasdefined_for = "in_oc", so the test makes anin_ocgroup._situationtreats anydefined_forother than None orin_nycas a state code and writesstate_code: "in_oc". - Observed: CI run 46640203294, job 142618004042, failed with
test_early_input_behaves_like_first_modeled_year_input[in_oc]:SituationParsingError: 'in_oc' is not a known value for 'state_code'. Reproduced locally against the snapshot: 1 failed, 52 passed (pr-10639-code-pytest.log). The failure is in the shard, which is why the "Check Rest Python shards" gate also fails. - Not main: the test dates from main #9650 (2026-09-28). Main's push run 46770751730 at base 50af7fb is green. No
in_ocvariable on main is an input; this PR adds the first uprated input whosedefined_foris a county. - Fix, either of:
- Add the variable to
NO_DEFAULT_UPRATING_VARIABLES. It selects a vehicle against a fixed $4,650 exclusion and uses a -1 sentinel, so indexing it is questionable anyway: a 2025 input of 4,600 read in 2027 would uprate above 4,650 and lose its exemption. - Or extend the test's
_situationto mapin_octoCApluscounty: ORANGE_COUNTY_CA.
- Add the variable to
- Severity: should-address. This is a PR-caused red check. Branch protection on main lists no required status contexts, so the coordinator can escalate if it treats the shard gate as required.
A2 — The household_vehicles_equity default of -inf is the model's first non-finite variable default and is not JSON-safe in the API metadata (OPEN)
- Location:
policyengine_us/variables/household/assets/household_vehicles_equity.py:15(default_value = -np.inf, 871d058). - Trigger: any consumer that serializes variable metadata or the default output. policyengine-api
country.pybuild_variablescopies a floatdefault_valueinto"defaultValue"._json_safepasses floats through, andmetadata_routes.pycallsjson.dumps, whose defaultallow_nan=Truewrites bare-Infinity. Parameter values go throughget_safe_jsonand are converted; variable defaults are not. - Executed (
pr-10639-code-diag/deem2_*.json):- Serializing the default with the API's expression gives
{"defaultValue": 0}on main and{"defaultValue": -Infinity}at the head. - Node's
JSON.parseof the head string throwsNo number after minus sign in JSON. - A scan of all variables finds
household_vehicles_equityas the only non-finite default. - A household that does not report equity now gets
household_vehicles_equity = -inf(main: 0).
- Serializing the default with the API's expression gives
- Downstream readers:
in_tanf_countable_resourcesis unchanged: 500 with equity unset and 5,500 with equity 25,000, the same on both trees.ca_oc_general_relief_countable_vehicle_valueis the intended reader of the sentinel.- No
addslist or parameter references the variable.
- Impact: once the API picks up this version, the US metadata response can contain invalid JSON for browsers. Any table that sums the variable over households without data would show -inf.
- Fix: use a finite sentinel (the OC input already uses -1) or an explicit "equity reported" input, or ship a coordinated API serializer change first.
- Severity: should-address. This is a cross-repo hazard; no benefit amount is wrong.
A3 — The axiom: needed line does not satisfy the Axiom Parity rule for a maintainer's PR (OPEN)
- Location: PR body, second axiom line: "axiom: needed for Colorado spouse resources and legal-separation income deeming, the Idaho cutoff and Orange County's vehicle rule".
- Expected: the repository CLAUDE.md "Axiom Parity" section allows
axiom: neededonly for "an external contributor [who] cannot complete the Axiom work". Otherwise the line must beencoded-correct,encoded, orqueued. Aqueuedline needs a dispatch-ready rulespec-us issue labelledpe-parity. This PR's author is a maintainer. The commits add substantive provisions: the Colorado 3.520.72(A) couple total and 3.520.72(C) / 3.520.63(D) legal-separation exclusion of resources and deemed income, and the Orange County Section 60.4.c one-vehicle net-equity exclusion. No rulespec-us issue exists for them. A read-onlygh issue list -R TheAxiomFoundation/rulespec-ussearch found Colorado AND-CS issues and OC §70 issues, but none for OAP spouse resources or OC §60.4.c. - Also: the Idaho cutoff is already on main, so it doesn't belong in this PR's parity line.
- The first line is fine.
TheAxiomFoundation/rulespec-us#1626is open, labelledpe-parityand covers 416.1202 / 416.1205 SSI deeming. - Proposed severity: SHOULD ADDRESS (axiom-line problem).
Suggestions
S1 — The changelog and body claim the Idaho BBCE cutoff, which main already carries (OPEN)
- Location:
changelog.d/round-summed-limits.fixed.md:1("End Idaho's non-cash SNAP categorical eligibility in July 2026") and the body's "Sites fixed" paragraph. - Observed:
git diff 50af7fba69 20d68c22c9 -- policyengine_us/parameters/gov/hhs/tanf/non_cash/asset_limit.yamlshows only the added IDAPA 16.03.04.305 reference. The2026-07-01: -.infentry with the H730 comment is already on main. The release note would announce a change this PR doesn't make. - IDAPA 16.03.04.305 (physical p. 37) does state the $5,000 BBCE resource limit, so the new reference supports the 2015 value.
- Fix: drop the Idaho sentence from the fragment and say in the body that the cutoff came in through the merge.
- Proposed severity: SUGGESTION.
Evidence Gaps
No material gaps reported.
Notes
- This round covers the four author commits since the 11-05 review and four merges of main.
- The round-1 should-address item (California county GR/GA asset tests) is RESOLVED.
-
- All five named county sites now call
round_to_cents, and so do Alameda, Marin personal property, LA home value, San Bernardino, SF CAAP, San Mateo, Riverside and NC SA.
- All five named county sites now call
-
- Each site has an at-limit / one-cent-over YAML pair.
-
- Executed: an LA single applicant with 29.54 + 5.73 + 64.73 = $100.00 is ineligible on main and eligible at the head, and $99 and $101 match main.
- Suggestions 1–3 are resolved, including the
np.isfinitehandling of non-finite limits. - Suggestion 4 is still open: the body lists about 14 unprobed state sites, the income-limit sweep and LA GR personal property's strict
<under "Sites outside this change", but no follow-up issue tracks them. - New behavior verified against sources:
-
- SSI resource deeming. It matches 20 CFR 416.1205(a)–(c) and POMS SI 01330.200 B:
<=against the couple limit, and an exact equal parental share.
- SSI resource deeming. It matches 20 CFR 416.1205(a)–(c) and POMS SI 01330.200 B:
-
- Orange County vehicles. These follow Section 60.4.c and 60.2: one vehicle's net equity is fully exempt up to $4,650, and a vehicle above that counts in full.
-
- Colorado spouse resources. A married client counts the spouse's resources against $3,000 (3.520.72(A)). A legally separated spouse's resources and income are excluded (3.520.72(C), 3.520.63(D), 3.534).
-
- Medically needy Medicaid and California MSP. Representation changes only.
- Noted, not findings: the Orange County fallback treats unsplit aggregate equity as one vehicle, which the body discloses. Indiana TANF's result is unchanged by the
-infdefault. - Both shard-4 failures trace to code-1. Main's push run at 50af7fb is green.
Validation Summary
Local tests at the reviewed head (review venv, policyengine-core 3.37.2, matching uv.lock; imports resolved to the snapshot): every touched program folder passed with 0 failures across two bounded runs (3,088 cases in the second run, in 6 shards). The Python run gave 1 failed and 52 passed; the failure is test_early_input_behaves_like_first_modeled_year_input[in_oc], reproducing code-1. Diagnostics executed the LA, Santa Clara, Colorado and SSI boundary households and serialized the variable metadata. Sources: 9 CCR 2503-5, 20 CFR 416.1205, POMS SI 01330.200, the Orange County GR resource rules, IDAPA 16.03.04.305 and the California county GR manuals; manifest check passed. CI at 20d68c2: 34 checks pass, 2 fail (Python Rest shard 4 and its gate; see code-1).
Timing
setup seconds: 18.00s; scope seconds: 60.00s; parallel review seconds: 1142.00s; policy role seconds: 351.20s; code role seconds: 1142.00s; adjudication seconds: 150.00s; consolidation cleanup seconds: 35.70s; elapsed seconds: 1722.00s
Review Severity
REQUEST_CHANGES. Open findings: 1 critical, 3 should address, 1 suggestions.
What and why
Before this PR, bank, stock and bond balances were stored as float32, and the float32 sum of $178.57, $1,547.79 and $273.64 was $2,000.000122, so the SSI resource test rejected an applicant who holds exactly $2,000. These three inputs now store float64 values. Some aggregates still store float32 and can drift when the model adds or stores the totals.
The drift occurs in float32 addition and in float64 sums stored back as float32. A sum that drifts below the limit can also pass a strict comparison. This PR covers asset and resource tests. Income-limit tests belong to a separate sweep.
Merge with main
The branch merges main at
6fa4eaf6d3,89a15b72f5,c44636b2b7,59d6806230andab596b0733. The merge atc44636b2b7resolved nine conflicts, and the merge atab596b0733resolved two Idaho conflicts. The Idaho BBCE cutoff and the June and July boundary cases are present.SSA divides parental excess equally among eligible children and divides it again when a child becomes ineligible. The regulation limits deeming to resources above the parental allowance. POMS SI 01330.200 B · 20 CFR 416.1202(b)(1)
The allocation loop uses integer cents for whole-cent allowances and limits. For example, $1,966.67 plus one third of $100 exceeds $2,000 by one third of a cent. Fractional-cent reforms use decimal subtraction and division before conversion to float64. SSI and medically needy Medicaid use the float64 share in their final tests. Iowa SSA uses its float32 share.
Change
round_to_centsreturns dollar amounts rounded to cents as float64. Whole-cent asset tests use it to recover the represented total before comparing with a limit.meets_limit_with_shareaccepts a positive infinite limit. Negative infinity and NaN fail the comparison.Sites fixed
The PR changes 85 Python files. Of those, 82 are under
policyengine_us/variables: seven federal, 55 state, 15 county and five household files. San Bernardino has three resource comparisons in one formula.Federal sites cover SSI eligibility and parental deeming, SNAP and BBCE, Medicare Savings Programs, medically needy Medicaid and optional senior or disabled Medicaid. California’s Medicare Savings Program test sums the component balances in cents. Idaho’s non-cash SNAP categorical eligibility ends July 1, 2026.
State TANF and other cash assistance sites cover AK, AR, AZ, CA, CT, DC, DE, FL, GA, IA, ID, IN, KS, KY, ME, MI, MN, MO, MS, MT and ND. They also cover NE, NH, NJ, NM, NV, NY, OK, OR, PA, RI, SC, SD, TN, TX, UT, VT, WA, WI, WV and WY.
Other state sites cover CA CAPI, CO OAP, CT SSP, IA SSA and parental deeming, IL AABD, MD PAA, MN MSA, MS HMW, NC Special Assistance, NH SSP and VA Auxiliary Grant. Colorado OAP pools intact spouses’ resources under the strict married cap. A legal separation decree reported by either spouse excludes the separated spouse’s resources and income and applies the strict unmarried resource cap.
County sites cover Alameda, Contra Costa and Santa Clara personal property. They also cover Los Angeles cash and assessed home value, Marin liquid assets and personal property, Orange County resources, Riverside property, San Bernardino resources, San Francisco CAAP personal property and San Mateo property. Orange County exempts one qualifying vehicle’s net equity and honors explicitly reported zero total equity. When the qualifying vehicle’s equity is unavailable, the model uses the total net equity as a proxy for one vehicle. A single vehicle over the exemption threshold counts in full. San Mateo’s tests state the assumed deduction from additional-vehicle equity.
Sites outside this change
is_ccdf_asset_eligible,ia_cca_asset_eligible,il_hbi_resource_eligible,in_ccdf_asset_eligible,ma_ccfa_asset_eligibleandtx_ccs_asset_eligiblecompare one storedspm_unit_assetsinput.oh_ccap_eligiblesums accounts against $1 million. Float32 cannot hold every cent at that size.ca_wdp_asset_eligible,dc_ccsp_asset_eligible,il_hbwd_asset_eligible,ma_eaedc_assets_limit_eligible,ms_wd_resource_eligibleandwi_shares_asset_eligible.mo_ssp_resource_eligible,mo_liheap_eligible,mt_liheap_eligible,nc_lieap_eligible,oh_rss,sd_ssp_care,_wi_ctsand the Iowa LIHEAP savings threshold.Below $32,768, the error from three float32 inputs and two float32 additions stays below half a cent. Some California and New York Medicaid and MSP limits exceed that bound.
Overlapping PRs
Tests
The branch adds 206 net named YAML cases relative to main. They cover totals at the limit and one cent away, cases with fractional vehicle amounts, and Orange County, San Mateo, SSI, medically needy Medicaid, Colorado OAP, Idaho BBCE and California MSP regressions.
The Idaho SNAP and joint SSI files include the earlier float32 totals as direct regression inputs. SSI tests cover fractional-cent equality for one child and for three children, as well as the existing just-over-limit cases. The deeming cases cover children who stay in or leave the division, an SSI child at $2,000.0001, and a New York Medicaid share fractionally above $33,038.
The rounding property checks 2,000 three-part splits. Two direct helper cases cover the infinite individual limit and mixed limits.
Validation
At 317618787b and on its merge with main at 8e81d66, 57 YAML files pass 770 cases. Two Python helper files pass three tests, Ruff passes, and eight mutants fail their intended regression cases.
An earlier run at 676bf30 and on a merge with main at e530416 passed 869 cases in 54 YAML files and 263 tests in four Python files. In that run, named cases rejected 30 behavior-changing mutants, and restoring each of six original behaviors failed a regression. Riverside’s old inline rounding and the shared helper pass the same 12 cases. The two county partner files that read the changed variables pass with their existing expectations.
Household results change at the tested asset limits, Idaho’s July cutoff, Orange County’s vehicle-input cases, and Colorado’s legal-separation resource and income cases. California MSP changes in both directions at the January 2026 boundary. Population impact is not measured.
axiom: TheAxiomFoundation/rulespec-us#1626 queued for SSI deeming
axiom: needed for Colorado spouse resources and legal-separation income deeming, the Idaho cutoff and Orange County’s vehicle rule
🤖 Generated with Claude Code