Skip to content

Determinism: construction compile-gate in, x2 sampling gate out (Phase D) - #6594

Merged
briansrls merged 16 commits into
mainfrom
session/deep-koi-605
Jul 14, 2026
Merged

briansrls merged 16 commits into
mainfrom
session/deep-koi-605

Conversation

@briansrls

@briansrls briansrls commented Jul 14, 2026 •

Copy link
Copy Markdown
Contributor

Determinism: construction gate in, x2 sampling gate out (Phases C.1-live + D)

Completes the determinism-mechanism plan's gate-replacement: make v2.lens.determinism the standing forward guard over the v2 compile door, then delete the x2 sampling gate it replaces.

Why (§5 — construction over validation)

The old tools.emit_determinism_gate was validation: compile the corpus to Rust twice and diff -r (~12m, corpus-denominated). That proves "two runs coincided" — a sample, not "output is a function of declared inputs". C.2 (#6576) made the v1 seed emitter map_keys-free, so emit determinism is now a construction property. Removing a post-hoc check that construction superseded is exactly §5's "prefer the single authority from which the realization is derived over a check that flags it after the fact."

What lands

Live construction gate (completes C.1's AC4):

  • v2.lens.determinism.determinism_compile_gate — a rooted whole-tree findings walk (one located diagnostic per nondeterministic-root call node), enrolled in v2.compiler.compile.always_required_root_lenses, mirroring accumulator_copy_compile_gate (Complexity as a compile citizen: accumulator-copy enrolled as a required root-grain compile lens #6527). Reds the instant a bare map_keys reach enters the v2 compile door; vacuously green today (v2 has zero map_keys calls).
  • Discriminating controls in reach_witness_test.dag: RED on a planted map_keys call and a nested-in-subtree reach; GREEN on a clean call and the sorted_map_keys deterministic sibling.

x2 gate deleted (Phase D / AC6):

  • Removed EmitDeterminismGate from type Gate — compile-red-guided the full consumer touch-list across ci_gate, ci_gates, floor_effect_gate_witness, floor_materialization, merge_admission, commit_workflow (incl. the whole GithubActionsEmitDeterminismJob CI-job surface), ci_spec, ci_workflow, ci_floor_plan.
  • Deleted dag/tools/emit_determinism_gate.dag + dag/tools/emit_determinism_transport.dag; regenerated ci.yml (the emit_determinism job is gone — build → ci is now the whole serial chain).
  • Re-homed the duplicate-computation lens witness (computation_demand_duplication_witness_test.dag) onto a self-contained synthetic ReplicatedOracle fixture (it had borrowed the x2 transport as its TypedArgvInvocation example; its property is independent of emit-determinism).
  • heavy_pair_spec scheduler control re-pinned to RegenVerifyGate (heavy + host-compiler + off-floor: the faithful analog of the removed gate, preserving the exact heavy count).

Coverage / scope (honest boundary)

The gate is enforced exactly like accumulator_copy (#6527): via floor-enrolled fixture tests and every validate_then_compile door invocation (self-host witnesses) — growing as v2 self-hosts. DagCompileCleanGate drives the v1 seed, so this is the forward wall for the v2 door, not a whole-corpus live scan. v1 emit stays construction-only (map_keys-free by C.2) with no active guard — operator ruling 2026-07-14 (b): a dying §7 seed carries no active guard; the construction guarantee replaces the sampling oracle. Phase B (physics-grounding via kind: Observation) and Phase F (cross-function derivation) remain gated/deferred.

Verification (green-by-execution, on the merged tree)

  • Full compile-clean over dag + src/v2 (the DagCompileCleanGate): 0 diagnostics.
  • Generated-artifact drift gate: ExitSuccess (ci.yml == authority).
  • 9 witness tests green: the 4 determinism gate discriminators; witness_gate_roster_matches_coproduct_arms (roster == type Gate arms — the consistency guard for the arm+roster removal); affected_set_universe_gate_processes_match_declared_gates; witness_plan_serializes_heavy_resolves (scheduler serialize-heavy with the RegenVerify substitute); the two re-homed duplicate-computation controls.
  • Re-verified after merging origin/main (which touched 00_compile.dag/fix(compile): subtree required-lens roster O(n²) cost-shape (fact_density lane) #6579, commit_workflow.dag, ci_floor_plan.dag and the v1 seed) and rebuilding the seed binary.

🤖 Generated with Claude Code

@gunbai-bot gunbai-bot Bot changed the title emit determinism Determinism: construction compile-gate in, x2 sampling gate out (Phase D) Jul 14, 2026
@gunbai-bot
gunbai-bot Bot marked this pull request as ready for review July 14, 2026 07:29
Brian Searls and others added 5 commits July 14, 2026 07:49
…er-repoint split + Phase D emit_determinism deletion

Keep main's split of the over-broad gunbc.ci_spec import into
gunbc.ci_spec {specs} + gunbc.ci_gate {gates}, minus the Phase-D-deleted
gunbc_ci_emit_determinism_spec and EmitDeterminismGate symbols. Supersedes the
dashboard-auto-committed unresolved merge (81aac8d).

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

gunbai-bot Bot commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

The CI red here is the pre-existing main-red, not this PR.

The only failing check is ci at batch-1 dag_compile_clean_gate_passes (returned Bool(false)) — the always-whole-tree compile-clean gate (fn_arrow_decl_substrate_is_whole_tree false, blocked-on-#6239). Reproduced locally on this head (6a85823):

non-exhaustive match: missing variant(s) Srv3InstallReconcileObserve, DurableApprovalGrantRecord,
DurableApprovalGrantRead, Srv3InstallMediaFetch, Srv3SeededInstallMediaRemaster, ... Srv3ReceiptEmit
(dag/gunbc/fleet_converge_cli.dag :: converge_cli_applied_knob_count)

Cause: the shell→dag srv3/converge slices (#6572/#6586/#6598) expanded the host-effect coproduct with ~12 Srv3* / DurableApprovalGrant* variants; the match in fleet_converge_cli.dag — a file this PR does not touch — wasn't updated. Because the whole-tree compile-clean gate is always-on and stops batch-1 before everything else, this reds every open PR (11 of 12 open PRs red; only #6604 green).

Owned and already fixed by #6604 (adds _ => fallback to converge_cli_applied_knob_count; CI-green, mergeable). I'm not pushing a duplicate fix into a load-bearing lane I don't own (a wrong fallback over an effect coproduct is a §5 masking risk). Once #6604 merges and green main is re-merged here, this PR's compile-clean gate clears; I'll re-verify the full floor (batch-2 witnesses + the determinism_compile_gate) on the re-merged tree before calling it ready. Phase D itself was CI-green standalone at 113e7f41c (pre-merge base, whole-tree compile-clean receipt ok=true).

— sent from deep-koi-605

@briansrls
briansrls merged commit 609ede4 into main Jul 14, 2026
2 checks passed
@briansrls
briansrls deleted the session/deep-koi-605 branch July 14, 2026 19:03
gunbai-bot Bot pushed a commit that referenced this pull request Jul 14, 2026
…reflects landed gate + dropped Phase B

Audit finding: the determinism mechanism (A/C/D) landed and the x2 emit gate was
deleted (#6551/#6576/#6594), but docs still described the superseded model. The code
is clean — the stale concepts (NonDetSource, DeterminismClass, OperationDeterminism)
exist in ZERO .dag files; the lens's in-code prose is current. This is DESIGN §6
parallel-ledger drift, fixed here:

- delete docs/plans/determinism-mechanism-design.md — a stale parallel ledger whose
  body §0-§9 described the superseded NonDetSource label enum / DeterminismClass +
  OperationDeterminism split / emit_determinism_gate-as-permanent-backstop. Authority
  is the carrier (dag/std/determinism.dag, src/v2/lens/determinism.dag), not a doc.
- DESIGN.md open thread (via design_document.dag, regenerated): "P1 landed" ->
  landed + enforced by construction; remaining = E (consolidation + rename),
  F (cross-function, gated on SymbolIndex); Phase B (kind:Observation clock/entropy
  roots) DROPPED — resource Clock/Entropy + kind:Observation are dead (0 consumers,
  ~1 real occurrence), so grounding would cement a §3 fork for no displaced cost.
- non-fold-irreducible-residue-catalogue.md: remove 2 rows naming deleted symbols
  (determinism_class_eq / non_det_source_eq).
- mechanism-inventory-red-controls.md: EmitDeterminismGate row -> determinism_compile_gate.
- type-env-single-authority-design.md: repoint the inbound link to the deleted doc.

DESIGN.md regenerated via main_wet (drift gate green). No code changes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
briansrls pushed a commit that referenced this pull request Jul 14, 2026
…ded gate + dropped Phase B (#6628)

* WIP: emit determinism

* WIP: emit determinism

* WIP: emit determinism

* WIP: emit determinism

* WIP: emit determinism

* WIP: emit determinism

* WIP: emit determinism

* Phase D: regenerate ci.yml — remove emit_determinism job (x2 gate deleted)

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

* WIP: emit determinism

* WIP: emit determinism

* Resolve merge conflict in ci_floor_plan.dag: main #6591 ci_gate definer-repoint split + Phase D emit_determinism deletion

Keep main's split of the over-broad gunbc.ci_spec import into
gunbc.ci_spec {specs} + gunbc.ci_gate {gates}, minus the Phase-D-deleted
gunbc_ci_emit_determinism_spec and EmitDeterminismGate symbols. Supersedes the
dashboard-auto-committed unresolved merge (81aac8d).

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

* docs: dissolve stale determinism parallel-ledger; DESIGN open-thread reflects landed gate + dropped Phase B

Audit finding: the determinism mechanism (A/C/D) landed and the x2 emit gate was
deleted (#6551/#6576/#6594), but docs still described the superseded model. The code
is clean — the stale concepts (NonDetSource, DeterminismClass, OperationDeterminism)
exist in ZERO .dag files; the lens's in-code prose is current. This is DESIGN §6
parallel-ledger drift, fixed here:

- delete docs/plans/determinism-mechanism-design.md — a stale parallel ledger whose
  body §0-§9 described the superseded NonDetSource label enum / DeterminismClass +
  OperationDeterminism split / emit_determinism_gate-as-permanent-backstop. Authority
  is the carrier (dag/std/determinism.dag, src/v2/lens/determinism.dag), not a doc.
- DESIGN.md open thread (via design_document.dag, regenerated): "P1 landed" ->
  landed + enforced by construction; remaining = E (consolidation + rename),
  F (cross-function, gated on SymbolIndex); Phase B (kind:Observation clock/entropy
  roots) DROPPED — resource Clock/Entropy + kind:Observation are dead (0 consumers,
  ~1 real occurrence), so grounding would cement a §3 fork for no displaced cost.
- non-fold-irreducible-residue-catalogue.md: remove 2 rows naming deleted symbols
  (determinism_class_eq / non_det_source_eq).
- mechanism-inventory-red-controls.md: EmitDeterminismGate row -> determinism_compile_gate.
- type-env-single-authority-design.md: repoint the inbound link to the deleted doc.

DESIGN.md regenerated via main_wet (drift gate green). No code changes.

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

---------

Co-authored-by: Brian Searls <briansearls1@gmail.com>
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
briansrls added a commit that referenced this pull request Jul 14, 2026
…m (single-authority canonical name) (#6643)

* WIP: emit determinism

* WIP: emit determinism

* WIP: emit determinism

* WIP: emit determinism

* WIP: emit determinism

* WIP: emit determinism

* WIP: emit determinism

* Phase D: regenerate ci.yml — remove emit_determinism job (x2 gate deleted)

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

* WIP: emit determinism

* WIP: emit determinism

* Resolve merge conflict in ci_floor_plan.dag: main #6591 ci_gate definer-repoint split + Phase D emit_determinism deletion

Keep main's split of the over-broad gunbc.ci_spec import into
gunbc.ci_spec {specs} + gunbc.ci_gate {gates}, minus the Phase-D-deleted
gunbc_ci_emit_determinism_spec and EmitDeterminismGate symbols. Supersedes the
dashboard-auto-committed unresolved merge (81aac8d).

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

* docs: dissolve stale determinism parallel-ledger; DESIGN open-thread reflects landed gate + dropped Phase B

Audit finding: the determinism mechanism (A/C/D) landed and the x2 emit gate was
deleted (#6551/#6576/#6594), but docs still described the superseded model. The code
is clean — the stale concepts (NonDetSource, DeterminismClass, OperationDeterminism)
exist in ZERO .dag files; the lens's in-code prose is current. This is DESIGN §6
parallel-ledger drift, fixed here:

- delete docs/plans/determinism-mechanism-design.md — a stale parallel ledger whose
  body §0-§9 described the superseded NonDetSource label enum / DeterminismClass +
  OperationDeterminism split / emit_determinism_gate-as-permanent-backstop. Authority
  is the carrier (dag/std/determinism.dag, src/v2/lens/determinism.dag), not a doc.
- DESIGN.md open thread (via design_document.dag, regenerated): "P1 landed" ->
  landed + enforced by construction; remaining = E (consolidation + rename),
  F (cross-function, gated on SymbolIndex); Phase B (kind:Observation clock/entropy
  roots) DROPPED — resource Clock/Entropy + kind:Observation are dead (0 consumers,
  ~1 real occurrence), so grounding would cement a §3 fork for no displaced cost.
- non-fold-irreducible-residue-catalogue.md: remove 2 rows naming deleted symbols
  (determinism_class_eq / non_det_source_eq).
- mechanism-inventory-red-controls.md: EmitDeterminismGate row -> determinism_compile_gate.
- type-env-single-authority-design.md: repoint the inbound link to the deleted doc.

DESIGN.md regenerated via main_wet (drift gate green). No code changes.

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

* WIP: emit determinism

---------

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