Skip to content

Emitter: declare libc in emitted Cargo.toml (fresh-emit cargo-green) - #7105

Closed
briansrls wants to merge 3 commits into
mainfrom
dispatch/5-regen-cutover
Closed

briansrls wants to merge 3 commits into
mainfrom
dispatch/5-regen-cutover

Conversation

@briansrls

Copy link
Copy Markdown
Contributor

Re-earns the post-#6243 fresh-emit re-measure receipt

The prior re-measure receipt was never merged to main — it lives only on session/neat-hawk-785 (an older pre-fork branch). So the receipt was still owed on main; this re-earns it and closes the last emitter gap.

Re-measure (non-destructive regen_stage0 --emit-fresh + cargo build, on main tip)

rustc errors
Original receipt (2026-07-05) 1667
Fresh emit today 3 — all E0433, one root: libc
Fresh emit + libc 0 — cargo-green

The emitter restoration already on main (the field_access_field_is_boxed / shared_types predicate) closed ~all of the 1667. The sole remaining gap: emit_cargo_toml omitted libc from the emitted [dependencies], but the emitted crate bundles the copied host-physics v1_interpreter.rs, which uses libc::clock_gettime(CLOCK_THREAD_CPUTIME_ID) for the fast-lane eval budget — so a fresh crate is cargo-RED without it. (The committed stage0 Cargo.toml already carries libc directly; this brings the emitted manifest into parity.)

The fix

One dep row in emit_cargo_toml's base_deps (src/v1/05_emit_rust.dag):

+    emit_cargo_dep(name: "libc", version: "0.2", features: [])

Verified by execution (not deduction)

  • gen-1: the freshly-emitted v1_compiler_emit_rust.rs now emits the libc row (absent in baseline).
  • gen-2: running emit_cargo_toml through the interpreter over the live .dag yields a Cargo.toml containing libc = "0.2".
  • New execution witness dag/test/claim/emit_cargo_toml_libc_witness_test.dag (PASS) asserts this — RED control: drop the libc row → witness reds.

Not included (operator-gated)

The full write-mode cutover — regenerating all ~40 seed files (~4.3k lines of accumulated drift) and un-ignoring the witnesses — is a separate, heavier decision. This PR lands only the targeted emitter fix + its witness.

🤖 Generated with Claude Code

Re-earns the post-#6243 fresh-emit re-measure receipt (owed on main; the
prior receipt lived only on session/neat-hawk-785, never merged).

Non-destructive `regen_stage0 --emit-fresh` + cargo build on main tip:
1667 -> 3 rustc errors, all E0433 with one root -- `emit_cargo_toml`
omitted `libc` from the emitted [dependencies]. The emitted crate bundles
the copied host-physics v1_interpreter.rs, which uses
libc::clock_gettime(CLOCK_THREAD_CPUTIME_ID) for the fast-lane eval budget,
so the fresh crate is cargo-RED without the dep. Adding libc -> 0 errors,
cargo-green (matches the committed stage0 Cargo.toml, which already carries
it directly).

Verified by execution, not deduction:
- gen-1: emitted v1_compiler_emit_rust.rs now emits the libc row.
- gen-2: running emit_cargo_toml through the interpreter over the live .dag
  yields a Cargo.toml containing `libc = "0.2"`.
New execution witness emit_cargo_toml_libc_witness_test.dag asserts this
(RED control: drop the libc row -> witness reds).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cursor

cursor Bot commented Jul 23, 2026

Copy link
Copy Markdown

Bugbot is not enabled for your account, so this pull request was not reviewed.

Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs.

@briansrls

Copy link
Copy Markdown
Contributor Author

What this change does

Adds one dependency row — libc = "0.2" — to the emitted crate's Cargo.toml, authored in emit_cargo_toml's base_deps (src/v1/05_emit_rust.dag).

Why: the emitted crate bundles the copied host-physics v1_interpreter.rs, which calls libc::clock_gettime(CLOCK_THREAD_CPUTIME_ID) for the fast-lane eval-budget clock. The emitted manifest didn't declare libc, so a fresh-emit crate was cargo-RED with 3× E0433. The committed stage0 Cargo.toml already carries libc directly; this brings the emitted manifest into parity.

Impact: this was the sole remaining gap in the fresh-emit re-measure — 1667 → 3 → 0 errors (cargo-green). The rest of the original 1667 was already closed on main by the emitter restoration (field_access_field_is_boxed / shared_types predicate).

Verified by execution: gen-1, the freshly-emitted v1_compiler_emit_rust.rs now emits the libc row; gen-2, running emit_cargo_toml through the interpreter over the live .dag yields a Cargo.toml containing libc = "0.2". The new witness emit_cargo_toml_libc_witness_test.dag asserts this and reds if the row is dropped.

Scope is just the emitter fix + witness — not the full write-mode cutover.

The .dag emitter change adds the libc dep row, so the fresh self-compile of
emit_cargo_toml now emits it. Regenerate the committed seed so
v1_compiler_emit_rust.rs matches (regen_verify_gate fixed point). Exactly one
generated file changes; `regen_stage0 --verify` reports regen_divergence_count=0.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

Follow-up: regen fixed-point (CI regen_verify_gate)

The first push redded regen_verify_gate_passes — as expected for a .dag emitter change: the fresh self-compile of emit_cargo_toml now emits the libc row, but the committed seed didn't have it yet (the two-generation regen lag). Fixed by regenerating the stage0 seed (regen_stage0):

  • Exactly one generated file changes — src/v1/stage0/src/v1_compiler_emit_rust.rs (the emitted emit_cargo_toml gains the + emit_cargo_dep("libc", "0.2", ...) line).
  • regen_stage0 --verify → regen_divergence_count=0 (committed seed now matches fresh self-compile).
  • v1-compiler builds clean. (The v1-stage0-std-core / std_currency build error some targets show is pre-existing on main, unrelated to this change — verified against the un-patched baseline.)

Commit ddd1c09.

The new emit_cargo_toml_libc witness imported v1.compiler.emit_rust, but the CI
floor compiles dag/test/claim with source roots dag + src/v2 only (not src/v1),
so the import was unresolvable and redded dag_compile_clean_gate. Remove it and
fold the guard into the existing v1_source_audit witness, which reads v1 source
as text via filesystem_io (ReadsLiveTree) — the floor-compatible pattern for
auditing v1.compiler source. emit_generates_cargo_toml now also asserts the
libc dep row; RED control: drop the row -> witness reds. Execution coverage of
the emit itself remains the regen_verify_gate (dag emitter -> committed seed,
byte-exact).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@briansrls

Copy link
Copy Markdown
Contributor Author

Follow-up 2: floor witness source-root fix

The ci floor redded dag_compile_clean_gate — my new emit_cargo_toml_libc_witness_test.dag imported v1.compiler.emit_rust, but the floor compiles dag/test/claim with source roots dag + src/v2 only (not src/v1), so the import was unresolvable. (I'd resolved it locally with --source-root src/v1, which isn't the CI path.)

Fix (commit d7afe8c):

  • Removed the import-based witness.
  • Folded the guard into the existing v1_source_audit_witness_test.dag, which reads v1 source as text via filesystem_io (ReadsLiveTree) — the floor-compatible pattern for auditing v1.compiler source. emit_generates_cargo_toml now also asserts the libc dep row (RED control verified: drop the row → witness reds).

Execution coverage of the emit itself stays with regen_verify_gate (the .dag emitter → committed seed, byte-exact — green after the regen in follow-up 1).

@briansrls

Copy link
Copy Markdown
Contributor Author

Follow-up 3: remaining ci red is a pre-existing main-red, not this PR

The ci run redded on non_fold_residue_no_unrostered_or_stale (src/v2/lens/non_fold_residue_test.dag). Investigated — it is not caused by this PR:

So this PR's own changes are green (emitter fix + regen fixed point + floor-compatible witness); the red is inherited from main and will clear once main's residue roster is reconciled (owner of #7085), independent of this PR.

@briansrls briansrls closed this Jul 23, 2026
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