A3-2: remove deprecated work_stealing bool field (Layer 3 cleanup)#73
Merged
StarGazerM merged 1 commit intoMay 19, 2026
Merged
Conversation
Per docs/phase_a3_remove_deprecated_bool_fields.md section 3.2, retire the legacy `work_stealing: bool` shadow field across MIR, HIR, DSL, and runner-side consumers. The typed `WorkStealing()` pragma (with its `WSScope` wrap op materialized by `materialize_work_stealing`) becomes the sole emission driver. Surface changes: - mir.ExecutePipeline: drop `work_stealing` field. - HirRuleVariant: drop `work_stealing` field; hir/plan.py and hir/lower.py stop propagating it. - dsl.PlanEntry: drop `work_stealing`; Rule.with_plan loses the kwarg; `_BUILTIN_BOOL_SHADOW_PRAGMAS` loses the WorkStealing entry. `Rule.with_pragma(WorkStealing())` is the sole DSL surface. - materialize_work_stealing: drop the `if op.work_stealing: return` short-circuit; the wrap step is now unconditional. - mir/passes.py: add public `ep_has_work_stealing(ep)` helper (typed-pragma + WSScope-wrap presence check) that orchestrator, complete_runner, batchfile, and the concurrent-write predicate consume in place of the deleted `ep.work_stealing` read. - codegen/cuda/context.py: drop unused `is_work_stealing` field. - sorted_array/lowerings: `lower_scan_pipeline` now unwraps trailing `WSScope(InsertInto)` while flipping `ctx.ws_enabled=True` for the call, so the legacy `_lower_insert_into` body keeps emitting the WS-count shape byte-equivalent to today. The C4 DEAD CODE NOTE block is retired (D19 ratchet cap drops 8 -> 7). - mir/print.py: WSScope unwraps to its inner during s-expression printing so existing MIR goldens remain stable. Test updates: the WS-tagged integration fixtures and the WS e2e test migrate to `with_pragma(WorkStealing())`; the parallel atomic_ws plugin byte-equivalence test picks the WS EP via `ep_has_work_stealing` (wrap-op presence) instead of the deleted bool. All 253 jit-batch + 276 runner byte-equivalence fixtures remain green. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
StarGazerM
force-pushed
the
feat/a3-2-remove-work-stealing-bool
branch
from
May 19, 2026 16:34
5be94d3 to
00e4386
Compare
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Drops the deprecated
work_stealingbool field through its full lifecycle. End-state: typedWorkStealing()Pragma is the SOLE source of truth.What's deleted
mir.ExecutePipeline.work_stealing: boolfieldWorkStealing → work_stealingentry from_BUILTIN_BOOL_SHADOW_PRAGMASPlanEntry.work_stealingfield +Rule.with_plan(work_stealing=...)kwargHirRuleVariant.work_stealingfieldmaterialize_work_stealinghandler short-circuitDEAD CODE NOTEblock inlowerings/__init__.pycontext.is_work_stealing(was unused)How consumers migrated
mir/passes.py: addedep_has_work_stealing(ep)helper (checks typedWorkStealinginep.pragmasORWSScopewrap inep.pipeline). Concurrent-write predicate now reads through it.codegen/cuda/{orchestrator,complete_runner,batchfile}.py: allop.work_stealingreads →ep_has_work_stealing(...)call.sorted_array/lowerings/__init__.py:lower_scan_pipeline: unwraps trailingWSScope(InsertInto)while save/restoringctx.ws_enabled=True— byte-equivalent by construction.mir/print.py: addedWSScopeprinter (unwraps to inner) so MIR s-expression goldens stay stable.examples/polonius_test.py: migratedsubset_transfromwith_plan(work_stealing=True)towith_pragma(WorkStealing()).D19 ratchet impact
Test plan
test_byte_equivalence_jit(253) +test_runner_byte_equivalence(276 + 2 pre-existing skips) — all passtest_pragma_work_stealing_end_to_end.py+ WS plugin test + InsertInto byte-eq — green (rewritten to use typed pragma path)grep -rn "ep.work_stealing|ExecutePipeline.work_stealing" src/srdatalog/→ 0 hits (only docstring mentions + lowering-internalctx.ws_enabledscratch flag remain)Cross-PR conflict expectations
dsl.py+mir/types.pytuple/field removals; D19 cap (each A3-* PR decrements by 1, so cap landing order needs alignment). Trivial unions.🤖 Generated with Claude Code