Repository navigation
test: pin what a background-originated program mount cannot name (#230 E1) - #238
Conversation
…E1) #230's E1 spec reads as though the addressing for a `mount-program-run` already exists — its readiness table lists "MTS-resident compiled create" as built. It is built, but only for the first screen, where the main thread *renders*: the applier holds the plan object itself and keys `boundPrograms` on it, so nothing has to be named because nothing crosses a realm. E1 inverts that. The background renders a keyed range and asks the main thread to instantiate a resident program, so it has to name one. It cannot: - `lynxMainThreadProgramObjectAst` (compile-universal.js:4232) returns null off the main-thread compile, so the background falls back to `lynxTemplateObjectAst` and gets the interpreted `{kind:'template'}` description. The background compile never sees the program. - `UniversalProgramPlan` carries no serializable identity — no name, no index, no digest. `bind` and `create` are functions, so they are realm-local by construction. - The two compiles' shared vocabulary is `kind` and `slots` alone: a category and a shape, neither of which distinguishes two programs with the same slot map, which two rows of one table routinely have. That asymmetry is not an oversight. It is a deliberate #163 invariant, pinned by the "changes nothing outside the main-thread lynx compile" gate in this same file. E1 has to renegotiate it, which makes it a wire-ABI decision rather than an added op. These two tests state that consequence positively so the design lands against a checked fact. Red-verified by removing the thread gate — the exact change E1 would make — which turns both red alongside #163's own byte-identity gate, so E1 cannot quietly widen the background chunk without updating them deliberately. No product code changes. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_019RsC3U39kUuLKajZANeTVy
|
Answering the open scope question (comment 5462016946): accepted in full — the readiness table overstated, cross-realm nameable programs do not exist today, and E1 is a wire-ABI renegotiation rather than an op addition. Ruling and re-sequencing (E2 → E3 → E1, E1 design issue first) in #230, comment 5465592015. Hold implementation here until that design issue exists. Generated by Claude Code |
|
The gate question this PR raised is answered: per the ruling on #230 (issuecomment-5465592015) E1 is re-scoped as a wire-ABI renegotiation and sequenced last, and its design issue is now #246. This PR stays held and stays draft — deliberately. Its two tests are the guard that makes the renegotiation explicit: they go red the moment the background compile learns the program exists, alongside #163's own byte-identity gate. That is the property #246 §5 asks to retire knowingly rather than quietly, so the tests are worth more unmerged-and-red-on-demand than merged and forgotten. One thing #246 adds that this PR left as an open shape: the deterministic key it hypothesised already half-exists. The branch-name question in this PR's follow-ups is still open and still flagged on every PR since. Generated by Claude Code |
Summary
E1's opener. I went to build
mount-program-runand found that the thing the issue's readiness table lists as already built — "MTS-resident compiled create" — is built only for the first screen, where the main thread renders. A background-originated mount has no way to name a resident program, and closing that gap means renegotiating an invariant #163 deliberately pinned.This PR is the finding stated as two tests. No product code changes.
Why
The first-screen join needs no addressing at all: the main thread renders, so the applier holds the
UniversalProgramPlanobject itself and keysboundProgramson it (host-driver.ts:4332). Nothing crosses a realm, so nothing has to be named.E1 inverts the direction — the background renders a keyed range and asks the main thread to instantiate a resident program — and there is nothing for it to say:
lynxMainThreadProgramObjectAstreturns null whenstate.universalRuntime?.thread !== 'main-thread'(compile-universal.js:4232), so the caller at:4351falls back tolynxTemplateObjectAstand the background gets the interpreted{kind:'template', slots, create}it has always had.UniversalProgramPlancarries no serializable identity (universal-core.ts:308) — no name, no index, no digest.bindandcreateare functions, so they are realm-local by construction and cannot travel.kindandslots. A category and a shape. Neither distinguishes two programs with the same slot map, which two rows of one table routinely have.And the asymmetry is not an oversight — it is a tested #163 invariant. The gate directly above these new tests,
changes nothing outside the main-thread lynx compile, exists precisely to keep the background chunk and universal bundle byte-identical across the backend switch. So E1 is not "add an op": it is a wire-ABI decision that has to renegotiate that promise.mount-template-run's existingprogramfield is not the precedent it looks like, either — it is a wire-carried template descriptor the MTS applier walks (protocol.ts:368), which is the interpretation cost E1 exists to delete, not a reference to a resident program.Changes
Two tests in
packages/octane/tests/compiler/lynx-main-thread-program.test.ts, the file whose subject is "the join, which is the part neither package can test alone":kind:'program'on the main thread andkind:'template'on the background, with the slot map identical — two encodings of one plan;Validation
pnpm format:check— not run repo-wide;pnpm format:filesclean on the one changed file.pnpm typecheck— not run; test-only change, and the file typechecks as part of the run below.pnpm test— not run in full.packages/octane/tests/compiler/lynx-main-thread-program.test.ts→ 14 passed (was 12).packages/octane/tests/compiler/+lynx-main-thread-program-first-screen.test.ts→ 46 files, 1490 passed, 1 skipped, 0 failed.pnpm syncclean, no generated changes.Red-verified with the exact change E1 would make. Removing the thread gate at
compile-universal.js:4232— which is how the background would learn the program exists — turns both new tests red, alongside #163's own byte-identity gate:Restored, 14/14. That is the point of the pair: E1 cannot quietly widen the background chunk without updating them deliberately.
Risk / follow-ups
This needs your gate before I build further, and it is the second time E1's ordering has come up.
The addressing has to be designed, and the shape of it is a build-time key emitted into both compiles so the background can name what the main thread holds. The raw material exists — both compiles walk the same
state.plansin the same order from the same source, which is what makesderiveLynxMainThreadProgram's same-source derivation signature-gateable in the first place — so a deterministic key is derivable. What it costs is #163's byte-identity promise for the background chunk, and a disagreement between the two compiles would bind a mount to the wrong program, so the key has to make drift a build error rather than a runtime surprise.I have not built that, for the same reason I stopped before the speculative
compactHostsredesign in Order 3: it is an ABI decision, not a slice.Second, restating what Order 3 measured (issuecomment-5461743426), because it bears on whether E1 is the right next step at all: E1's op reduces ~20 commands per row to one on the wire, but for
createthe wire is already onemount-template-runcommand and the cost is on the receiver — ~282 ms of clear-prepare and a 1.87× recreate penalty at 10k, both caused by a warm container falling off the compact regime. That is E2's territory, and it is where the oracle's margin is. The goal set the sequence E1 → E2 → E3 before that measurement existed; I have followed it, and this PR is the honest first step of E1, but E2-first still looks like the shorter path tocreate ≤ 1.0× upstream.Also still open from the earlier slices: the harness assigned branch
claude/octane-issue-66-phase-a-7wz97z, butcreate-a-prmandates afeat/|fix/|docs/|test/|perf/topic branch for the label bot. I have used topic branches throughout; say if you want the assigned name instead.Provenance
agent-authored)Generated by Claude Code