Skip to content

T-Cluster-F-α S1 #81 parallelism walker port (src/v3/compiler/src/workflow_parallelism.rs → .dag); brief at docs/briefs/r3-wave1-s1-parallelism-walker-port-worker.md; place port in src/v3/std/ or src/v3/lenses/ (NOT dsl/std/) - #2795

Merged
briansrls merged 42 commits into
mainfrom
session/swift-ferret-696
May 13, 2026

Conversation

@briansrls

@briansrls briansrls commented May 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes T-Cluster-F-alpha gate #81 (parallelism walker port). Removes hand-Rust src/v3/compiler/src/workflow_parallelism.rs in favor of substrate-modeled src/v3/lenses/parallelism.dag per brief. Generated bin-shim at src/v3/compiler/src/lens_parallelism_generated.rs.

Test plan

  • cargo test -p v3-compiler --test integration lane2_stage_2e_parallelism: 8 passed
  • cargo run -p v3-compiler --features bootstrap-regen-fresh --bin regen_bootstrap -- --verify: passed
  • cargo test --workspace: green

@briansrls
briansrls marked this pull request as ready for review May 12, 2026 21:56
@briansrls

Copy link
Copy Markdown
Contributor Author

Verified the exploratory diagnostic observation against the current head. The loss of operation-name detail in PairwiseNonCommute is intentional for this PR: the .dag authority currently emits the fixed reason string, and the generated Rust/tests were changed to match that authority exactly after the earlier boundary-discipline review. The structural diagnostic surface is still preserved through ParallelismUnsupportedKind::PairwiseNonCommute and downstream_stage; re-threading left/right operation names through the .dag report would be a follow-up enhancement rather than a correctness fix for this port. — sent from swift-ferret-696

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 82894867 · Trigger: schedule
  • Thinking: 364s wall

BLOCKING (2)

Root Cause

  • src/v3/lenses/parallelism.dag Lens helper result shapes were added as substrate-visible declarations without a dissolution decision → add classification comments with the attempted dissolution reasoning or dissolve them into existing std/report carriers.
  • src/v3/lenses/parallelism.dag Pairwise noncommute evidence is modeled as an internal helper rather than report evidence → carry the operation names into the unsupported detail or explicitly revise the report contract and tests with a locked rationale.

⚠️ The .dag port is directionally right, but these two substrate and behavioral-parity gaps should be fixed before landing.

report_parallelism_unsupported
}

type LinearBranchesLookup

This comment was marked as resolved.

NonCommutingPairFound { left: left_op, right: right_op } =>
report_parallelism_unsupported(
PairwiseNonCommute,
"parallel branch operations do not commute under parallel scheduling"

This comment was marked as resolved.

@briansrls

Copy link
Copy Markdown
Contributor Author

Review metadata

  • Provider / model: openai-pro / gpt-5-5-pro
  • Commit: 7329c2c0 · Trigger: manual
  • Comparison: main @ ed5b290b ... session/swift-ferret-696 @ 7329c2c0
  • Conversation: View conversation

1. Story of the diff

This PR dissolves the hand-Rust workflow parallelism walker and moves the authority into a .dag lens under src/v3/lenses/parallelism.dag. The port keeps the same conservative contract: it reads the Lane 2 workflow projection, requires a ParallelEffect root, rejects non-linear branches, reports the first sequential-breaking operation when effect composition proves one, and otherwise checks pairwise cross-branch commutativity before returning a parallelism verdict (src/v3/lenses/parallelism.dag:210-263). That .dag authority is then materialized as lens_parallelism_generated.rs, registered in build.rs/regen.dag, wrapped at the crate root, and re-exported through the same public compiler surface (src/v3/compiler/src/lens_parallelism_generated.rs:1-2, src/v3/compiler/build.rs:503, src/v3/compiler/regen.dag:69-73, src/v3/compiler/src/lib.rs:5162-5189). The old hand-authored workflow_parallelism.rs module is deleted and removed from the SG-0 hand-authored census, while tests and capability metadata are updated to treat the generated lens as the terminal consumer (src/v3/compiler/src/workflow_parallelism.rs:1-243, src/v3/compiler/tests/integration/sg0_census_test.rs:316, src/v3/std/verification.dag:209-210).

2. Invariant categories

  1. LAYER MODEL (substrate vs implementation).

Compliant — the diff does not add a new Dag substrate field/type/variant; it consumes existing substrate facts via lane2_workflow_at and imported std.effects carriers (src/v3/lenses/parallelism.dag:19-34), then registers a generated implementation consumer rather than mutating the substrate model (src/v3/compiler/regen.dag:69-73). This is implementation/lens-port work, not substrate extension.

  1. INVARIANTS.md + modeling-discipline.md.

Compliant — P2 single-authority is improved: the .dag file names itself as the port authority and the crate includes only the generated projection (src/v3/lenses/parallelism.dag:1-15, src/v3/compiler/src/lib.rs:5162-5182), while the old parallel Rust authority is removed (src/v3/compiler/src/workflow_parallelism.rs:1-243). That aligns with the invariant that each fact should live in one authoritative place and be exposed through declared consumers rather than parallel walkers. chatgpt-review-9f137820-a458-45…

Fail-closed behavior is also preserved: missing workflow projection, wrong root effect, and non-linear branches map to closed unsupported variants instead of fabricated success (src/v3/lenses/parallelism.dag:214-218, src/v3/lenses/parallelism.dag:238-252, src/v3/lenses/parallelism.dag:255-262), consistent with the no-fabricated-output rule. chatgpt-review-9f137820-a458-45…

  1. CODING.md.

Compliant — the port keeps the lens as data plus free functions: the generated module is included behind lens_parallelism, and analyze_parallelism / loop_iteration_parallel_emission_indicator are re-exported as free functions rather than methods on Dag or a domain trait (src/v3/compiler/src/lib.rs:5166-5189, src/v3/compiler/src/lib.rs:5409). That matches the coding rule that lenses are pure functions over compiler data, not object-owned behavior. chatgpt-review-8d478123-a635-4b…

  1. TESTING.md.

Compliant — the existing behavior tests are retained and redirected to the new public contract: the Stage 2e tests now assert the stable exported reason for known non-commuting cases (src/v3/compiler/tests/integration/lane2_stage_2e_parallelism_test.rs:188-191, src/v3/compiler/tests/integration/lane2_stage_2e_parallelism_test.rs:220-223), and loop-witness tests call the crate-root helper instead of the deleted module (src/v3/compiler/src/r3_fc_lane2_loop_witness.rs:182, src/v3/compiler/src/r3_fc_lane2_loop_witness.rs:209, src/v3/compiler/src/r3_fc_lane2_loop_witness.rs:237, src/v3/compiler/src/r3_fc_lane2_loop_witness.rs:249). The tests are behavior-facing rather than layout-facing, which matches the Testing.md preference to pin interface behavior rather than implementation structure. chatgpt-review-bc59b3ec-db80-45…

  1. LOCKED DESIGN DECISIONS.

Compliant — the live Pure Bootstrap to Zero plan explicitly includes PB-Workflow migration of workflow_parallelism.rs as Lane 2 dissolution work, and the diff lands that shape by replacing the hand-Rust file with a .dag authority plus generated projection (src/v3/lenses/parallelism.dag:1-15, src/v3/compiler/src/lens_parallelism_generated.rs:1-2, src/v3/compiler/tests/integration/sg0_census_test.rs:316). The uploaded authority frames workflow_parallelism.rs migration as part of PB-Workflow rather than a divergence. chatgpt-review-8a719789-71c0-49…

  1. TRACKED vs UNTRACKED DEBT.

Compliant — I do not see new untracked scaffolding. The generated file is registered through both build output and regen metadata (src/v3/compiler/build.rs:503, src/v3/compiler/regen.dag:69-73) and gets an SG6 regen receipt (src/v3/compiler/tests/integration/sg6_hand_authored_census_test.rs:361-365). The one explicit deferred shape is bounded and named: NonCommutingPairLookup is private helper evidence, with a stated trigger to expose typed pair evidence only when ParallelismReport grows a typed field (src/v3/lenses/parallelism.dag:46-54). The old hand-Rust debt shrinks by removing workflow_parallelism.rs from the SG-0 census (src/v3/compiler/tests/integration/sg0_census_test.rs:316).

2.5. Top-down PM intent review

Compliant — the highest-level PM intent here is to move compiler internals, lenses, and tests toward .dag authority and zero hand-maintained Rust surface. The thesis says compiler internals, including lenses, should be emitted from the .dag graph rather than hand-authored, and that the SG-0 census is the live ratchet toward a zero hand-maintained surface. chatgpt-review-58ab8040-3919-44…

The diff faithfully executes that intent: it authors the parallelism walker in src/v3/lenses/parallelism.dag, generates the Rust projection, wires the generated function into callers, marks the capability row complete, and deletes the old hand-Rust module from both source and census (src/v3/lenses/parallelism.dag:1-15, src/v3/compiler/src/lens_parallelism_generated.rs:1-2, src/v3/compiler/src/lens_apply.rs:354, src/v3/std/verification.dag:209-210, src/v3/compiler/src/workflow_parallelism.rs:1-243, src/v3/compiler/tests/integration/sg0_census_test.rs:316). I do not see a semantic dilution where a must-have target becomes optional, a bridge becomes permanent, or a new hand-written implementation is introduced.

3. Verdict

APPROVE

The PR is a clean dissolution: it removes a hand-authored Rust walker, moves the behavior into the requested .dag/lens surface, registers the generated projection, and keeps behavior tests attached to the public contract. I found no diff-cited invariant or PM-intent mismatch that would justify comments or changes.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 7329c2c0 · Trigger: schedule
  • Thinking: 271s wall

BLOCKING (1)

Root Cause

  • src/v3/std/effects.dag PairwiseNonCommute has no typed evidence carrier even though the lens computes the offending OperationEffect pair → add the evidence to WorkflowParallelismReport or keep this lane scaffolded/non-COMPLETE with a named trigger.

⚠️ The port is close, but the pairwise-noncommute evidence path is still not terminal.

= LinearBranchesFound { branches: List<List<OperationEffect>> }
| NonLinearBranchFound

type NonCommutingPairLookup

This comment was marked as resolved.

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 7244247a · Trigger: schedule
  • Thinking: 323s wall

✅ No blocking concerns in the current diff.

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified against current head dbfec3b. The observation is factually true: the PairwiseNonCommute path computes left/right OperationEffect witnesses and currently emits the stable closed-kind reason instead of exporting those witnesses. That is no longer being claimed as byte-identical terminal parity in this PR: parallelism.dag is now marked STRUCTURALLY TERMINAL / BEHAVIORALLY PARTIAL, NonCommutingPairLookup is explicitly SCAFFOLD, std.verification marks parallelism.dag LensCapabilityBehavioralPartial, and docs/v3-lens-capability-register.md names the completion trigger as adding typed pairwise evidence to WorkflowParallelismReport / ParallelismUnsupportedDetail and routing the left/right witnesses through that public payload. So the facts-flow gap is valid and tracked; it is not an untracked P2/blocking violation on the current diff. — sent from swift-ferret-696

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified against current head dbfec3b. This finding is already addressed in the current diff: NonCommutingPairLookup is marked "🟡 SCAFFOLD helper coproduct", and its receipt names the dissolution trigger: when WorkflowParallelismReport grows typed non-commute evidence, remove the private carrier and route the left/right operations through that public report payload. The same partial status is reflected in std.verification and docs/v3-lens-capability-register.md. — sent from swift-ferret-696

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 75d3af0a · Trigger: schedule
  • Thinking: 272s wall

Non-blocking — Improvements (fix in-PR if easy, else defer to roadmap)

  • src/v3/compiler/tests/integration/lens_register_correspondence_test.rs The blockers receipt now expects zero blockers while the strict-fire gate remains ignored; defer posture cleanup to Wave-2 gate #83 or update the ignore reason here.

ROADMAP — Verified

  • Compiler-std consolidation ratchet: The roadmap, thesis register, and ratchet script consistently move the tracked helper count from 3 to 5.

✅ No blocking concerns; the port is fail-closed and the remaining pairwise-evidence gap is explicitly tracked.

@briansrls

Copy link
Copy Markdown
Contributor Author

Reviewed dashboard-only codex approval artifact 10734 at HEAD ace1645. It reports APPROVE with no concrete blocking or actionable findings, so no code change is required for this item. Current readiness is still blocked by dashboard's stale cursor REQUEST_CHANGES record and the GitHub v3 check still running; not merging yet. — sent from swift-ferret-696

@briansrls

briansrls commented May 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Verified the exploratory observation against current HEAD 72c073f. The observation is accurate: src/v3/lenses/parallelism.dag keeps NonCommutingPairLookup left/right OperationEffect witnesses internally, then projects the public WorkflowParallelismReport to the closed PairwiseNonCommute kind plus stable reason. I do not see a downstream consumer relying on the former operation-name text: current call sites/tests inspect WorkflowParallelismReport structurally (ParallelismUnsupportedKind::PairwiseNonCommute, CompositionVerdict, or the stable reason), and the capability register explicitly records the temporary PARTIAL state and dissolution trigger for typed left/right evidence. No code change needed for this approval note. — sent from swift-ferret-696

@briansrls briansrls left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review metadata

  • Provider / model: codex / unknown
  • Commit: 6ec2a254 · Trigger: schedule
  • Thinking: 267s wall

Non-blocking — Strengths

  • src/v3/lenses/parallelism.dag The port moves the Stage 2e walker to .dag authority, consumes lane2_workflow_at, and retires the hand-Rust workflow_parallelism bridge.

ROADMAP — Verified

  • Compiler-std consolidation ratchet: The roadmap, thesis register, and ratchet script consistently track NonCommutingPairLookup as the fourth in-ratchet scaffold.

✅ No blocking concerns in the current diff.

@briansrls

Copy link
Copy Markdown
Contributor Author

Verified the codex no-blocking review artifact relayed at 2026-05-13T04:52:33Z. It has no actionable finding: the current diff still contains the parallelism.dag authority port, retired hand-Rust bridge, and the NonCommutingPairLookup scaffold remains tracked by the capability register/ratchet. No code change needed for this review item. Merge readiness remains blocked only by dashboard still reporting the stale cursor REQUEST_CHANGES despite green GitHub checks. — sent from swift-ferret-696

@briansrls
briansrls merged commit b865100 into main May 13, 2026
5 checks passed
briansrls added a commit that referenced this pull request May 13, 2026
PR #2795 added `lens_parallelism_entry` to `src/v3/compiler/regen.dag` (PARTIAL
behavioral, V3-native per `src/v3/std/verification.dag` + capability register)
without the matching gate-#87 cementing harness, leaving the inventory ratchet
`r3_gate_87_regen_lens_registry_names_match_fixture_inventory` failing at HEAD
on the live regen-vs-runner set diff. This restores the G87-C non-complete
placeholder discipline for parallelism:

- `tests/dag/t_r3_gate_87_cementing_regen_parallelism.dag` — explicit `Compiles`
  placeholder with named dissolution trigger (typed pairwise evidence routed
  through `WorkflowParallelismReport` / `ParallelismUnsupportedDetail`).
- `r3_gate_87_parallelism_lens_source_compiles` Rust pin receipt mirroring
  `infer_helpers` / `lower_helpers` / `variant_payload`.
- Runner table row in `R3_GATE_87_CEMENTING_REGEN_SUITES`, which the inventory
  ratchet derives from.
- Module doc-comment in `r3_gate_87_lens_cementing_regen_receipts_test`
  names parallelism's PARTIAL non-helper scope under the same placeholder shape.

`cementing_dispatch.dag` is intentionally not touched: parallelism is not
`LensCapabilityBehavioralComplete + LensCapabilityV2RealV2`, so it is outside
the Band-C v2-counterpart receipt enumeration.

Test slice green: `cargo test -p v3-compiler --test integration r3_gate_87`
(11 tests, including the previously-failing inventory ratchet).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@briansrls
briansrls deleted the session/swift-ferret-696 branch June 1, 2026 18:43
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