Skip to content

t27b: unify put_bytes on the emit_kit subrange form; ledger deliberate copies - #13601

Merged
gHashTag merged 1 commit into
masterfrom
lane/dupe-putbytes-unify
Nov 11, 2026
Merged

gHashTag merged 1 commit into
masterfrom
lane/dupe-putbytes-unify

Conversation

@gHashTag

@gHashTag gHashTag commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #13594.

put_bytes: one definition in emit_kit

macho.t27 splices emit_kit::put_bytes via use instead of carrying its own full-range copy; the two macho callers pass explicit ranges. The spliced module embeds the whole kit into the generated macho.rs -- that is how t27 use works at the gen-rust level; the .t27 source has one definition, which is what the duplicate-bodies gate measures.

Ledger for the deliberate copies

The remaining flagged groups are cross-domain copies with divergent types and no t27 generics to unify them, recorded in duplicate_bodies_baseline.txt in this same commit:

  • find: red_black_tree vs avl_tree (RB vs AVL node types)
  • put_bytes: emit_kit vs session_store (t27b vs t27os layering)
  • put_dec 3,2 (usize/u64/u32 variants per domain)

Evidence

  • t27b native test macho: 22/22 + 1 invariant held (the spliced put_bytes works)
  • cargo test -p t27b: green
  • macho resealed without --force (spec compiles, tests pass)
  • dupe_scan: 0 unledgered errors on this tree

Closes #13594.


Note

Low Risk
Scoped refactor to a shared byte-copy helper with existing oracle tests and an updated seal; no auth or runtime security surface.

Overview
Mach-O spec now shares put_bytes with emit_kit instead of defining a full-slice copy locally. macho.t27 splices it via use tri::t27b::emit_kit, and put_group / write_object pass explicit [a..b) ranges.

Regenerated gen/rust/tri/t27b/macho.rs and resealed T27bMachO (closure lists emit_kit, toolchain Zig 0.17.1, hashes updated; tests still 22/22).

Duplicate-body ledger (tools/duplicate_bodies_baseline.txt) records intentional cross-domain copies: put_bytes, find, and put_dec arity 3,2.

Reviewed by Cursor Bugbot for commit 4c531f4. Bugbot is set up for automated code reviews on this repo. Configure here.

…e copies (#13594)

macho.t27 splices emit_kit::put_bytes via use instead of carrying its own
full-range copy (the two bodies differed only in call convention); the two
macho callers pass explicit ranges. The remaining flagged groups
(find: red_black_tree vs avl_tree; put_bytes: emit_kit vs session_store;
put_dec 3,2) are deliberate cross-domain copies with divergent types and
no t27 generics to unify them -- recorded in the duplicate-bodies ledger
in this same commit.

Verified: t27b native macho 22/22 + invariant; cargo test -p t27b green;
macho resealed without --force; dupe_scan errors cleared on this tree.

Closes #13594
@cursor

cursor Bot commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: c7786ae9-e079-4758-849f-4f61efac77dd)

@github-actions

Copy link
Copy Markdown
Contributor

PR Dashboard

Generated at: 2026-11-11 04:35:47 UTC

Summary

Status Count
Total Open PRs 35
PRs with Failing Checks 32
PRs with All Checks Green 3
READY 0
FAILING 32
PENDING 0
NO CHECKS YET 0

These columns do not partition: 0 + 32 + 0 + 0 = 32, and there are 35 open PRs. A PR is being counted twice or not at all.

Seal Status

  • ⚠️ STALE -- sha256(compiler.rs)=c850fb7383ef != manifest seal=87e5cbd3ad94.
    The committed NMSE numbers were certified against an older compiler.rs.
    Run scripts/reseal-check.sh locally for the two-step reseal command (advisory; not a merge gate).

@gHashTag
gHashTag enabled auto-merge (squash) November 11, 2026 04:37
@gHashTag
gHashTag merged commit 2b04224 into master Nov 11, 2026
38 of 47 checks passed
@gHashTag
gHashTag deleted the lane/dupe-putbytes-unify branch November 11, 2026 04:37
gHashTag added a commit that referenced this pull request Nov 11, 2026
…ge form (Refs #13592)

Master unified put_bytes on the emit_kit subrange signature (#13601);
the restored lane copies still called the 3-arg form and were refused
by typecheck (emit-bitexact: 2 specs newly fail to generate). 86 call
sites lowered mechanically; typecheck passes (elf 0 errors, wasm 0
errors).
gHashTag added a commit that referenced this pull request Nov 11, 2026
…own source again; elf/wasm move to the emit_kit put_bytes subrange form via put_str (Closes #13602)

- specs/compiler/core/t27core.t27: SRC_MAX 262144 -> 524288. t27core.t27
  grew past 256 KiB on master (#13194) and the core refused to read its
  own source ('input exceeds SRC_MAX'), which failed core_selfhost and
  grew the test-ratchet failing set by 2. One line; the fixpoint test
  passes again (measured: core(t27core) == gen-c(t27core)).
- bootstrap/gen/rust/verified/*.rs (7 files): regenerated with t27c
  gen-rust after the rust_num_suffix usize branch changed the shared
  helper bytes; signed_receipt_reader green.
- specs/tri/t27b/emit_kit.t27: put_str, the full-range form elf.t27 and
  wasm.t27 were written against; one definition, spliced through
  macho's use; test extended.
- specs/tri/t27b/elf.t27, wasm.t27: the ~90 put_bytes call sites moved
  to put_str. #13594 (#13601) unified put_bytes on the 5-arg subrange
  form and left these two callers typechecking-refused on master --
  emit-bitexact newly flagged them on the merge commit.
- gen/rust/tri/t27b/{elf,wasm}.rs regenerated; emit_kit/macho/elf/wasm
  and t27core seals re-saved without --force.

Verified locally (zig 0.16 on PATH): core_selfhost 1/1,
signed_receipt_reader 9/9, seal currency STALE 0, seal coverage OK 113
known-broken, dupe_scan exit 0, l2_regen_check ok.

Closes #13602
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.

master red: duplicate-bodies — stale flat twins + macho/emit_kit and tree copies

1 participant