Skip to content

Compiled-core parity: fixture profiles declare and prove their integer slots - #241

Merged
ctate merged 7 commits into
mainfrom
feat/compiled-core-parity-0020
Jul 31, 2026
Merged

ctate merged 7 commits into
mainfrom
feat/compiled-core-parity-0020

Conversation

@ctate

@ctate ctate commented Jul 31, 2026 •

Copy link
Copy Markdown
Collaborator

Every compiled-core fixture profile now declares the integer slots its transpiled twin attests, and the paired-core battery proves the attestations byte-for-byte on the wire.

What changed

  • The five fixture profiles declare i64 integer slots — 107 of the 108 slots the transpiled lane's own contracts class as i64 across the corpus. The compiled contracts now attest what the transpiled contracts attest, instead of shipping integer_slots: [].
  • Classed slots ride the i64 wire encoding. Declaring a class changes the canonical wire for that slot, so the adapters' snapshot, helper-result, record, and channel encoders write classed slots as i64, and text-input decoding reads selection offsets and composition cursors as i64. Selection offsets use a saturating reader because select-all sends the maxInt to-the-end sentinel, which every consumer snaps to the text's length.
  • Integer writes prove in place. Classed writes bind the value, range-guard it with ordered comparisons, and state wholeness with Math.trunc; counter bumps saturate at the provable ±(2^53 − 1) ceiling. The text SDK gains one provable selection constructor (caretSelectionAt) so editor-produced selections carry their proof at the construction site. All edits are semantics-neutral for values that are integers in fact, and the transpiled lane stays green throughout.

The one slot that stays undeclared

Model.pastBytes holds 2^53 by design — it exists to probe the boundary where 2^53 and 2^53 + 1 share a wire value, so it cannot also attest staying inside the provable window. A comment at its declaration records this.

Follow-up commit

Ten arm slots whose payloads share a lowered record shape (id, code, pid spellings across sibling arms) initially could not be declared because agreeing declarations on one shape refused; they now coalesce, and the profiles declare them. The same round tightened two other seams: synthesized record slots (audio clocks, the composition cursor) gained compile-time write obligations, so their decode-ingress sites prove in place with the same range-guard-and-trunc idiom the adapters already use, and two profiles dropped a subscriptions_export naming a function their entry modules never exported, which now refuses instead of resolving silently.

Verification

  • Full five-fixture battery green with all slots declared: 60/60 steps, 86/87 tests, 1 skip (the PARITY_SHOTS-gated screenshot test, which skips in both lanes).
  • Each compiled contract's integer_slots diffs against the transpiled reference list exactly as the residue above — nothing extra, nothing else missing.
  • zig build, zig build test, zig build test-ts-core-e2e, and zig build sidecar-conformance all pass.

This battery does not run in CI. The runners have no external core compiler installed, so the step is a no-op there. It is a local and future-CI harness, not a gate on this pull request.

ctate added 5 commits July 30, 2026 17:11
- The shared wire codec, the markup adapter, and the markup frame channel prove decoded integer slots in place: bind the value, range-guard it with ordered comparisons, and state wholeness with Math.trunc at the write.
- Fixture counter bumps saturate at the i64 class's provable ceiling, ±(2^53 − 1), so range discharges.
- Model.pastBytes stays f64-classed: it holds 2^53 by design, past the provable window.
- The text SDK gains one provable selection constructor: every editor-produced selection is range-guarded and stated whole with Math.trunc, keeping the proof local to the construction site.
- The ai-chat composer binds composition bounds and proves them at the write; -1 stays the no-composition sentinel.
- The chat_response status and nextId bumps prove in place with the same guard-and-trunc idiom.
- Samples, probe results, and ps rows bind, range-guard, and Math.trunc their counts at each classed write; unprovable values keep the previous sample or skip the line like any other malformed row.
- The adapter proves dispatch values and classed helper returns in place with the same guard-and-trunc idiom.
- Structurally identical union arms lower to one record shape, so one code slot and one pid slot carry the class for their siblings (SC4009 keeps colliding declarations out).
- Catalog ids, playback clocks, and queue counters bind, range-guard, and Math.trunc at each classed write; the clock-tick cap comparison replaces Math.min so the proof stays in view.
- The adapter proves its ten classed helper returns in place with the same guard-and-trunc idiom.
- The id-carrying Msg arms share one lowered record shape with QueueEntry, which carries the class for all of them (SC4009 keeps colliding declarations out).
- Snapshot, helper-result, record, and channel encoders write classed slots with wI64 (optionals via wOptionalI64), matching the contract each adapter now attests.
- Text-input decoding reads selection offsets and composition cursors as i64; selection offsets ride a saturating reader because select-all sends the maxInt to-the-end sentinel, which every consumer snaps to the text's length.
- Classed helper results route through their proven wrappers and encode with wI64.
@vercel

vercel Bot commented Jul 31, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
native-sdk Ready Ready Preview Jul 31, 2026 6:50am

- The ten same-shaped Msg arm slots join the soundboard and system-monitor profiles, so the declared set covers every provable reference slot and only the deliberate 2^53 boundary probe stays f64.
- Decode ingress proves in place where synthesized record slots carry write obligations: soundboard's id dispatches and audio clocks, and the shared composition-cursor decode, each range-guarded with wholeness stated by Math.trunc.
- The ai-chat and markup profiles drop a subscriptions_export naming a function their entry modules never exported; a dangling name refuses instead of resolving silently.
@ctate
ctate merged commit ad6fa36 into main Jul 31, 2026
27 checks passed

This branch was successfully deployed

1 active deployment
Preview — ba083452 Deployed Jul 31, 2026 by vercel[bot]
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.

1 participant