Skip to content

c emission - #6650

Merged
briansrls merged 8 commits into
mainfrom
session/eager-ferret-110
Jul 15, 2026
Merged

briansrls merged 8 commits into
mainfrom
session/eager-ferret-110

Conversation

@briansrls

@briansrls briansrls commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Phase 0 — C emission reaches bar (c): green by execution

Flips the C (cpp) target's add from bar (b) (emits the expected source string) to bar (c) (a real cc compiles the emitted output and it runs correctly) — the first non-Rust target proven green-by-execution through the actual emit pipeline.

What lands

  • ProcessProgram coproduct in host_transport.dag: HostToolProgram { tool } | ProducedProgram { path }. A transport can now run a produced binary (./fixture), which cargo hid behind cargo run. This is the principled model (DESIGN §3) — a produced artifact is categorically not a PATH tool, so it doesn't belong in the tool registry.
  • host_tool_cc → "cc" registered in emit_host.dag; invocation_argv resolves the program coproduct.
  • C host transport in cpp.dag: cc fixture.c -o fixture → run ./fixture, 5-byte LE codec; runtime_row wired (was unconfigured).
  • Existing rust/go/ts/python/rust_test descriptors + the wire test lifted to program: (argv-identical mechanical lift).
  • Coverage-completeness test updated: cpp is now host-smoked (present count 4→5).

Verification

  • cpp_add_emit_host_run_all_holds PASS wet — emitted add(2,3) compiled by real cc, ran, wrote [0,5,0,0,0] = 5; plus nonzero-exit and byte-width-mismatch refusal discriminators fire.
  • Rust bar-c regression (emit_host_transport_wire_all_holds) still PASS wet — the lift didn't break the self-host path.
  • Whole-tree compile-clean (gunbc compile --target dag over dag/src/v2/src/v1) exit 0, zero errors.

Not in this PR (disclosed, not narrowed)

CI-wet-gate enrollment for cpp (a run_cpp_smoke in emit_host_gate) is the clean follow-up — the execution witness has the same enrollment status as the existing Rust wire test (run wet on demand, excluded from the hermetic floor). This is the next step toward CI-defending cpp bar-c.

Brian Searls and others added 3 commits July 14, 2026 23:41
ProcessProgram coproduct (HostToolProgram | ProducedProgram) so a transport
can run a produced binary; register host_tool_cc; wire cpp runtime_row
(cc compile fixture.c -> run ./fixture, 5-byte LE codec). New wet execution
witness proves emitted add(2,3)==5 via real cc, plus nonzero-exit and
byte-width-mismatch refusal discriminators. Existing rust/go/ts/python/
rust_test descriptors lifted to program: field (argv-identical; rust bar-c
regression re-proven wet). Coverage completeness test updated: cpp now
host-smoked (present count 4->5).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 14, 2026 23:58
Brian Searls and others added 2 commits July 15, 2026 00:24
…per-PR

The ProcessProgram change to v2.std.host_transport put 5 wave1_gate1 body-
producer/symbol-index witnesses into the affected set — they reach
host_transport transitively via extdeps.languages.dag. Those witnesses eval
~9.4s (real_ingest_lowers, local), over the 5s fast-lane budget, and were
enrolled per-PR via CommitWitnessClaim in gunbc.commit_workflow — a latent
over-budget landmine that only fired once a diff touched their closure (they
predict-skip on every normal PR, so main stayed green).

Per the documented remedy in commit_workflow_long_lane_note (an explicit
enrollment bypasses discovery exclusion; delete over-budget rows, don't
repoint), delete the two enrollments. The witness files stay under
src/v2/test/claim/long/ and run via the local recipe / scheduled lane. Also
consistent with the 2026-07-15 two-tier CI policy (slow/wet runs out-of-band,
not per-PR). No ci.yml drift: enrollments feed the runtime floor roster, not
ci.yml text.

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

gunbai-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

CI fix pushed — the 5 failures were an unrelated pre-existing landmine my diff exposed

The ci floor failed on 5 wave1_gate1 body-producer/symbol-index witnesses (src/v2/test/claim/long/…) hitting the 5s fast-lane eval budget — nothing to do with C emission.

Root cause (verified by execution, not guessed):

  • These witnesses eval ~9.4s locally (wave1_gate1_a1_real_ingest_lowers), well over the 5s budget — correctly homed in long/.
  • They were also enrolled per-PR via CommitWitnessClaim in gunbc.commit_workflow. An explicit enrollment row bypasses the long/ discovery exclusion (documented in commit_workflow_long_lane_note).
  • They reach v2.std.host_transport transitively via extdeps.languages.dag (witness → helpers → .dag target model → host_transport). My ProcessProgram change edits host_transport, so the affected-set marked these witnesses affected → they ran → over budget → RED.
  • On main they're predict-skipped on every normal PR (no diff touches their closure), so this landmine had never fired. main is green on all recent runs.

Fix (the documented remedy, not an improvisation): commit_workflow_long_lane_note already spells out the rule for exactly this case — "an explicit enrollment row bypasses discovery exclusion … Offlining an explicit row means deleting its declaration … Delete when the enrolled fns themselves are slow." Two prior enrollments (fold_lowering, accumulator_copy) were offlined the same way on 2026-07-12. So I deleted the two over-budget wave1_gate1 enrollments and recorded it in the note. The witness files stay under src/v2/test/claim/long/ and run via the local recipe / scheduled lane — no coverage is lost that ever worked (it only ever ran to fail). This is also consistent with the 2026-07-15 two-tier CI policy (slow/wet runs out-of-band, not per-PR).

No ci.yml drift: the enrollments feed the runtime floor roster (project_ci_floor_witness_entries), not the ci.yml text (0 wave1_gate1 references in ci.yml). Whole-tree compile-clean is green.

Cross-lane note: these keystones belong to the body-lowering / general-body-producer lane (#6620). If they want per-PR coverage back, the principled path is enrolling fast (<5s) check_fns or the scheduled long-lane trigger — not re-adding the >5s rows.

— sent from eager-ferret-110

@gunbai-bot

gunbai-bot Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Correction after merging main: adopted main's fix, reverted my deletion

Integrating main revealed that the wave1_gate1 budget issue was already fixed on main, more completely than my deletion — so I reverted my commit_workflow.dag change and took main's version wholesale. commit_workflow.dag is now identical to main; my branch's only diff is the C-emission changes.

Main's fix (the right one): reclassify the wave1_gate1 a1/b1 enrollments from CorpusWitnessKind → ExecutionWitnessKind (and add a c1 enrollment). That routes them from the hermetic discovery-corpus batch (where the operator 5s fast-lane budget is armed) to the Wet execution-corpus batch — and the budget is armed only for hermetic batches (claim_executor.rs: effective_budget = if execution_mode.is_hermetic() { fast_lane_budget } else { None }; execution_corpus_runnable_for is execution_mode: Wet). So the witnesses keep their per-PR coverage but run without the 5s wall, completing in ~9s each. This keeps the coverage my deletion would have dropped, and matches the 2026-07-15 two-tier CI policy (slow runs in the Wet lane, not the hermetic fast lane).

With my host_transport change, these witnesses are still pulled into the affected set — but now they land in the Wet execution batch (no budget) and pass, rather than the hermetic discovery batch that killed them at 5s. Whole-tree compile-clean is green on the merged tree.

— sent from eager-ferret-110

@briansrls
briansrls merged commit 9011600 into main Jul 15, 2026
2 checks passed
@briansrls
briansrls deleted the session/eager-ferret-110 branch July 15, 2026 01:09
briansrls pushed a commit that referenced this pull request Jul 15, 2026
…6637)

The affected-set-falsifier has been red on every cold sweep since 2026-07-15
04:32 UTC (last green 07-14 23:10, run 29374839251). It was doing its job:
three discovery witnesses returned Bool(false) against the whole corpus that
per-PR selection had predict-skipped. This clears the two non_fold_residue
ones; the inert_carrier one is a separate lens-precision question, left red
deliberately rather than papered over.

Stale rows deleted (roster 120 unique -> live 118; each verified as genuinely
migrated, NOT merely gone lens-invisible -- the converge_cli_applied_knob_count
trap):
  - nbd_proxy_serve.dag::shell_command_leading_lit_text
  - nbd_proxy_serve.dag::shell_rawline_starts_with_tool
    both fns DELETED by #6629 (P6 Part 2: RawLine body -> typed session-lease
    effect), firing the dissolve-on their rows carried.
  - emit_host.dag::run_test_claim_emit_vs_eval_verdict
    fn still exists (emit_host.dag:335) but #6650 enumerated its wildcard into
    three explicit constructor arms -- residue genuinely folded, no bare `_ =>`
    remains. Ratchet tightens.

Unrostered row backfilled: bash_composition_recognizer.dag::apply_role, landed
by #6637. Two-special-variant dispatch over TokenRole's 5 variants; the other
three all reduce to the closed run, so enumerating would clone the general arm
3x. Same class as the orch_emit_let_step row above it (receipt #10).

Green-by-execution (claim_batch, local):
  PASS non_fold_residue_no_unrostered_or_stale (src/v2/lens)
  PASS non_fold_residue_clean_holds            (dag/test/claim)
  FAIL inert_carrier_no_unrostered_or_stale    <- unchanged, see PR body
Discriminating RED control: both nfr witnesses were red on this same tree
before the roster edit and green after; no witness or assertion was weakened.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Jul 16, 2026
…; re-enroll cargo fmt in CI (de-fused from nextest) (#6691)

* WIP: falsifier is failing

* non_fold_residue roster: burn down 3 stale rows, backfill apply_role (#6637)

The affected-set-falsifier has been red on every cold sweep since 2026-07-15
04:32 UTC (last green 07-14 23:10, run 29374839251). It was doing its job:
three discovery witnesses returned Bool(false) against the whole corpus that
per-PR selection had predict-skipped. This clears the two non_fold_residue
ones; the inert_carrier one is a separate lens-precision question, left red
deliberately rather than papered over.

Stale rows deleted (roster 120 unique -> live 118; each verified as genuinely
migrated, NOT merely gone lens-invisible -- the converge_cli_applied_knob_count
trap):
  - nbd_proxy_serve.dag::shell_command_leading_lit_text
  - nbd_proxy_serve.dag::shell_rawline_starts_with_tool
    both fns DELETED by #6629 (P6 Part 2: RawLine body -> typed session-lease
    effect), firing the dissolve-on their rows carried.
  - emit_host.dag::run_test_claim_emit_vs_eval_verdict
    fn still exists (emit_host.dag:335) but #6650 enumerated its wildcard into
    three explicit constructor arms -- residue genuinely folded, no bare `_ =>`
    remains. Ratchet tightens.

Unrostered row backfilled: bash_composition_recognizer.dag::apply_role, landed
by #6637. Two-special-variant dispatch over TokenRole's 5 variants; the other
three all reduce to the closed run, so enumerating would clone the general arm
3x. Same class as the orch_emit_let_step row above it (receipt #10).

Green-by-execution (claim_batch, local):
  PASS non_fold_residue_no_unrostered_or_stale (src/v2/lens)
  PASS non_fold_residue_clean_holds            (dag/test/claim)
  FAIL inert_carrier_no_unrostered_or_stale    <- unchanged, see PR body
Discriminating RED control: both nfr witnesses were red on this same tree
before the roster edit and green after; no witness or assertion was weakened.

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

* WIP: falsifier is failing

* WIP: falsifier is failing

* Re-enroll cargo fmt in CI as a standalone step, de-fused from the nextest bundle

Operator ruling 2026-07-15. Restores fmt enforcement without re-enrolling
RustMonolithGate (still rejected).

WHY IT WAS GONE: tools.rust_gates_ci.run_gates welds two separable facts into
one ProcessExit -- fmt (4.3s measured, parse-only, no build, green) and nextest
(~37 GiB, compile+run, red on main). The 2026-07-11 ruling removed the bundle
for reasons that are ALL facts about nextest; fmt was collateral damage of that
fusion (DESIGN 3).

WHY THE HOOK ISN'T COVERAGE: the ruling's declared replacement was the pre-push
hook. That is an escape hatch (DESIGN 5) -- opt-in per clone via a manual
core.hooksPath, bypassable with --no-verify, absent in container worktrees --
and PROVEN ineffective, not just theoretically weak: in this very worktree
core.hooksPath points at a directory with no pre-push hook at all, and #6658
landed an unformatted .rs on main 2026-07-15 with nothing catching it. The hook
stays as fast local feedback, never as the wall.

SHAPE: standalone RunStep, FIRST in the build job -- a 4-second violation now
fails in 4 seconds instead of after the ~33min release build. build is not
protection-required itself, but ci needs:[build], so a red fmt blocks the
required job by construction. Toolchain already installs the rustfmt component
in ci_prelude_steps, so marginal cost is ~4s and no build.

Step-budget discipline (gunbc_ci_job_timeout_policy_disposition: "the backstop
is the exact step-sum + prelude"): the new step carries the aux cap and
gunbc_ci_build_job_backstop_timeout_minutes() gains exactly one aux term
(65 -> 70), so no step is uncapped and the sum stays exact.

Authority updated, not left lying: commit_gate_rust_suite_removed_disposition
declared "cargo fmt stays enforced by the pre-push hook". That claim is now
retracted in-row and the fmt half marked reversed; the nextest half and the
RustMonolithGate rejection are preserved verbatim.

ci.yml regenerated through the emit authority (expected_ci_yml), never hand-
edited; trailing-newline gotcha handled.

GREEN-BY-EXECUTION:
  PASS generated_artifact_drift_witnesses   <- the real drift gate, ci.yml byte-exact
  0 FAILs across ci_yaml_serializer, ci_compile_jobs, placement_grain,
    rust_gates_ci, ci_budget_tree witnesses
DISCRIMINATING RED: planted a fmt violation, ran the EXACT emitted step command
  -> exit 1 (caught); restored tree -> exit 0. The gate discriminates.

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

* Resolve merge conflict: drop duplicate nfr roster work, main landed it first

main (#6680 lane) independently made the identical nfr roster fix while this PR
was in review: same two nbd_proxy_serve stale rows deleted, same
emit_host::run_test_claim_emit_vs_eval_verdict stale row deleted, and the same
apply_role backfill added (its own wording, different position in the roster).

Resolution takes MAIN's side wholesale. Keeping mine would have produced two
apply_role rows -- harmless at use (the roster collapses to a BTreeSet) but a
pointless redundancy, and re-litigating identical work for authorship is not a
reason to diverge. cli_run.rs is now byte-identical to origin/main.

This PR therefore reduces to the work main does NOT have, verified against
origin/main:
  - the cargo fmt CI gate (de-fused from the nextest bundle) + its authority
    note amendment + regenerated ci.yml
  - the latent main fmt red fix (main still carries the unformatted import)

Independent convergence on the roster is a receipt for the falsifier itself:
two lanes hit the same cold-sweep reds and reached the same verdicts on which
rows were genuinely migrated vs still live.

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

* WIP: falsifier is failing

---------

Co-authored-by: Brian Searls <briansearls1@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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