Repository navigation
Conversation
OP2, OP3 and OP4 start side by side from this commit. They meet at one module: required inputs that name their source and status, the annual controls OP3's reader emits and OP4's law consumes, the exit-timing convention OP3's bridge and OP4's law share, and the roster columns and stream tags more than one part writes or reads. It also adds the four named refusals those parts raise (design §8). No projection reads this module yet, and it joins the reducer's exclusion list. Co-Authored-By: Claude Opus 5.5 <[email protected]>
OP4's exit law reads a row's nativity, and build_entrant_schedule already writes foreign_born on entrants, so conventions.py names that column. The reachability test never named open_population, so nothing asserted that the reducer can't reach the package the exclusion list leaves out of its identity. The test now builds the module set from the package itself, as it does for graph, so a part's new module gets the check unasked. A second test fails by name when a module in the package misses the list. The list keeps exact files, as tests/track_u2/test_u2_isolation.py requires. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The conventions mutants left three survivors at 68df739, and each named a property no example reached: - `math.fsum` against `sum`: 3.14's built-in `sum` compensates, so no random table told them apart. Just past a tie the exact sum rounds up where a compensated total stops. - the share's coercion to a plain float. - the bound at the annual probability, which no search reached on this platform's `expm1`. A patched `expm1` that rounds one unit high shows the bound holding. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review shared-r1 found that no test pinned entry_year_probability near zero: three mutants (log(1 - p) for log1p(-p), shares below 1e-10 read as zero, and results zeroed for annual risks below 1e-15) passed all 51 tests. Three regressions now pin it: - half of an annual risk of 2**-100 is exactly 2**-101; - a share of 2**-100 of an annual risk of 0.36 stays within one unit in the last place of a 200-digit Decimal oracle; - a certain exit stays certain at shares of 2**-1074, 2**-100, 0.25 and 1 - 2**-53. All 56 conventions tests pass, and each of the three mutants now fails. The implementation is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
open_population/live_fertility.py applies maternal fertility to the live roster. LiveRosterFertility draws one tagged uniform per woman at risk, reads her parity from the roster and carries it forward uncapped, and hands the year's births to an injected materializer once. The probability lookup and event schema follow engine/marital.py:349-400. ParitySeed labels a caller-supplied parity mapping with one of two named methods and a ConventionSource, and leaves omitted people missing. BirthDecadeRule declares how cohorts outside the fit are treated: refuse, continue from a fit decade, or zero outside the fit. Both keep their sources in draft until require_frozen passes. No seed, fit or convention value enters. A GPT-6.1 Sol lane wrote the module and its 111 tests on invented data. Both seal lists exclude the module after errors.py. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
WIP. OP2(b) of
docs/design/open_population.md: live-roster fertility with persistent parity. It's stacked on #599, whose commits show in this diff until that PR lands. Four files belong to this part:live_fertility.py,test_live_fertility.pyand one seal-list line in each of two files.What it adds
open_population/live_fertility.pyholds three pieces:LiveRosterFertilityapplies maternal fertility to the live roster each year.LIVE_FERTILITY_STREAM_TAGat her ordinal.models/family_transitions/components/fertility.py:190).engine/marital.py:349–400). Unlike that kernel, which starts parity at zero on each call (engine/marital.py:363), the step reads a woman's parity from the roster.ParitySeedlabels a caller-supplied parity mapping with one of two named methods and aConventionSource. It seeds nullable integer parity and leaves anyone it omits missing, so it never asserts a childless arrival (engine/entrant_domains.py:50–55).BirthDecadeRuledeclares how cohorts outside the fit are treated:refuse,continue_froma decade in the fit, orzero_outside_fit.Four refusals are new and live in the module:
ParitySeedMissing,BirthDecadeRuleInvalid,FertilityInputInvalidandFertilityDrawInvalid. Where §8 names the condition, the step usesIdOrStreamCollisionorExtrapolationUndeclaredfromerrors.py.A GPT-6.1 Sol lane wrote the module and its 111 tests on invented data. I read the module against the sealed code it cites.
No real value enters. The PR carries no seed, fit or convention choice.
ParitySeed.require_frozenandLiveRosterFertility.require_frozenrefuse any source short of frozen. Newborn girls stay outside the fertility risk set through OP2(a)'s marker until a later milestone admits them.Readings to check
agecolumn doesn't decide risk. Marked women and men skip the check.continue_fromcovers only cohorts after the fit. An earlier cohort outside the fit still refuses underExtrapolationUndeclared.zero_outside_fitstill draws a uniform for women in those cohorts and never gives them a birth. The kernel does the same: it draws for every eligible woman (engine/marital.py:385) and gives a cohort missing from the fit probability zero (models/family_transitions/components/fertility.py:191–193).Trueexcludes a woman, and a roster without the column admits every eligible incumbent.Invariants
Design §7's fertility rows, each with a property-based test alongside the examples:
Through
run_gate. The birth adapter accepts the additions, count and weight accounting reconciles every year, and a run with no woman at risk matches the closed run slice by slice.Evidence
On the host, one process, at this commit's tree:
tests/open_population/test_live_fertility.pyandtest_conventions.py: 167 passed in 34.55 s, 111 of them intest_live_fertility.py.-l 79) and Ruff come back clean.tests/estimates/test_birth_evidence_artifact.py: 14 passed in 36.14 s, so the seal holds withlive_fertility.pyin both exclusion lists.The builder's 50 mutants each ran under a 1.5 GiB cap with Hypothesis's explain phase off, after an unmutated control that passed (111 passed). All 50 fail a test, and none broke the run. The source file was restored after each, and the clone is clean at this commit.
Plan
Follow-up for the next design commit
The builder found a stale citation in sealed code.
engine/entrant_domains.py:51–52attributes zero-parity initialization tosteps.py:451–506, which materializes children. The zero start isengine/marital.py:363. The sealed file stays as it is; the design can cite the right line.🤖 Generated with Claude Code