Repository navigation
perf(birth): place a lifecycle birth on the live engine, no full-world checkpoint (Scaling A13) - #2624
Draft
genekogan wants to merge 2 commits into
Draft
perf(birth): place a lifecycle birth on the live engine, no full-world checkpoint (Scaling A13)#2624genekogan wants to merge 2 commits into
genekogan wants to merge 2 commits into
Conversation
…d checkpoint (Scaling A13) The lifecycle guard in drainInputs and the runner's preview ran probeNativeHumanBirth, a full snapshot and restore of the world, two or three times per birth (about 6-7 s of clock per birth on Eden 2026 with 50 acting). They now run MarsEngine.birthPlacementV1: spawnHuman's own placement search on the live engine, changing nothing, with the probe's verdict (humanBirthIssue) at the spot. The probe stays as the oracle: SIM_BIRTH_PROBE=1 decides by it, =oracle checks every placement against it. Same outcome, same reasons: no rule change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
3 tasks
…e navigation is unmoved (#2624 review) On whole ground the live search grew the ground window to the trial body and moved spatial.epoch, so a later far walk could be refused live and admitted on replay. nativeBirthPlacement now uses the probe there (livePlacementExact: no ground, or paged ground); placeNativeHumanBirth refuses it. The oracle tests also assert the epoch and window are unchanged by the live placement. engine-contract.md documents SIM_BIRTH_PROBE=1 (rollback) and =oracle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been 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.
Problem
When a Soul is born through the lifecycle (the account and Eden capabilities path), a busy world runs
probeNativeHumanBirthtwo or three times per birth: a full snapshot of the world, then a restore that rebuilds the spatial ground. On Eden 2026 with 50 Souls acting, that is about 6 to 7 s of the clock thread per birth. At even one create a second the world goes black and restarts (exit 75), and 0 of 100 creates complete. This PR places the birth on the live engine instead. Closes #2621.Acceptance
birthPlacementV1on the live engine agrees withprobeNativeHumanBirth's outcome (placement or refusal) on every case. State hashes are equal with the change off and on over the walk goldens and the birth tests. — evidence:node --test apps/server/src/birth-placement-eden.test.ts-> pass, 32 births on Eden 2026 compared:{"ready":30,"unavailable":2}. That is 16 plain births while a Soul walks, the arrival rings crowded until a birth is refused, and both hinted forms.node --test packages/engine-mars/src/birth.test.ts-> 10/10 pass. The crowd fills the arrival point on green field (91 ready, 4 refused, 4 hinted), on the legacy commons (13 ready, 4 refused, 4 hinted: thehumanBirthIssuerefusal) and on the safe commons (83 ready, 4 refused, 4 hinted). Existing, conflicting and deferred births are also covered. On every case the live outcome deep-equals the probe's, the state hash and tick are unchanged, andspawnHumanlands where the placement said.node --test apps/server/src/lifecycle-runner.test.ts-> 24/24 pass. A new test runs lifecycle births withSIM_BIRTH_PROBE=1(off), unset (on) and=oracle: the events, poses, engine state hash and kernel hash are equal.SIM_BIRTH_PROBE=oracle node --test packages/engine-mars/src/birth.test.ts packages/engine-mars/src/arrival-clearance.test.ts apps/server/src/lifecycle-runner.test.ts-> 35/35 pass, with every placement checked against the probe.spawnHuman's search is now an extraction with the same statements in the same order, and it has no switch.node tools/test-harness/walk/walk.mjs-> "walk: no place worse than the baseline". The hash-pinned engine tests (hash,commons-kitchen,terrain,water-geometry) pass 47/47, run together witharrival-clearance,commons,connected-shore-engineandcommons-arrival.NAV_PAGEDdefaults on), the guard (lifecycle-runner.ts) and the preview (arrival-placement.tsplanNativeBirth) callnativeBirthPlacement, which runs the probe only whenSIM_BIRTH_PROBEis1ororacle. Test "A13: the birth path never snapshots or restores…" -> 0 snapshots and 0 restores by default. Test "four pending births … with no detached probe" -> 0 restores for four lifecycle births, against 8 withSIM_BIRTH_PROBE=1. One exception: a world on whole (non-paged) ground (NAV_PAGED=0) keeps the probe, because there the live search grew the ground window and moved the navigation epoch (review finding on this PR). Test 'A13: on whole (non-paged) ground…' covers it: same navigation and the same later far walk as a twin that never placed a birth. The oracle tests also assert the live placement leaves the epoch and window unmoved.settled --wave, 100 creates at 1 a second with 50 acting, 2 repeats, base against candidate): clock ms per birth down at least 80 %; no black and no exit 75 at 1 a second; creates completed reported. — pending: the bars and the scoring rule were declared on the issue before any run (comment 6922107940). Eight runs were dispatched in one batch, uniform and event shapes × base and candidate × seeds 1 and 2 (comment 6922120597).Proof
Tier: T3 (
node tools/proof/tier.mjs; the coordinator expects T4 for the engine core)clipwith the kitjoin-burst(12 Souls join Eden 2026 one a second, on the candidate). The kit lives only on the proof branchagent/2621-clip, not in this PR.Self-audit
tsc --noEmit -p packages/engine-mars-> cleantsc --noEmit -p apps/server-> cleannode tools/test-harness/walk/walk.mjs-> no place worse than the baselinenode tools/changelog/compile.mjs --check-> 39 valid fragmentsspawnHuman's search twice: once in the guard and once in the apply. That is twowalk_toplans per ring spot tried, and it is A8a's proposed follow-up 2.LifecycleRunneris unchanged.birth.checkpoint-required). Keeping that answer is what makes this no rule change. The live placement no longer needs a checkpoint, so dropping the deferral would be a later rule change with its own id.spawnHumanextraction, which has no switch.docs/architecture/engine-contract.mdgets a Birth placement line documentingSIM_BIRTH_PROBE=1(rollback) and=oracle. The code comments inlifecycle-runner.ts,arrival-placement.ts,birth.tsandengine.tsare updated.Changelog
changes/2621-birth-on-live-engine.md(perf)Risk
SIM_BIRTH_PROBE=oraclechecks it live.SIM_BIRTH_PROBE=1on the world (the probe decides again), or revert this PR.Time: started 16:05 UTC. Work so far is about 0.5 h of the 4 h ceiling (draft at 16:25, review fixes 16:30-16:40 UTC), not counting runner waits. The A3 runs are still queued.
Outside Touches:
packages/engine-mars/src/engine.ts:spawnHuman's search extracted, plusbirthPlacementV1. The design names it ("movespawnHuman's placement into a read-onlybirthPlacementV1on the live engine").apps/server/src/arrival-placement.ts: the runner's preview (planNativeBirth) lives there.apps/server/src/birth-placement-eden.test.ts: a new test for the birth path.docs/architecture/engine-contract.md: one line documenting the flag (the coordinator asked for it).🤖 Generated with Claude Code