Skip to content

A3-2: remove deprecated work_stealing bool field (Layer 3 cleanup)#73

Merged
StarGazerM merged 1 commit into
design/redesign-packagefrom
feat/a3-2-remove-work-stealing-bool
May 19, 2026
Merged

A3-2: remove deprecated work_stealing bool field (Layer 3 cleanup)#73
StarGazerM merged 1 commit into
design/redesign-packagefrom
feat/a3-2-remove-work-stealing-bool

Conversation

@StarGazerM

Copy link
Copy Markdown
Collaborator

Summary

Drops the deprecated work_stealing bool field through its full lifecycle. End-state: typed WorkStealing() Pragma is the SOLE source of truth.

What's deleted

  • mir.ExecutePipeline.work_stealing: bool field
  • WorkStealing → work_stealing entry from _BUILTIN_BOOL_SHADOW_PRAGMAS
  • PlanEntry.work_stealing field + Rule.with_plan(work_stealing=...) kwarg
  • HirRuleVariant.work_stealing field
  • materialize_work_stealing handler short-circuit
  • C4 DEAD CODE NOTE block in lowerings/__init__.py
  • context.is_work_stealing (was unused)

How consumers migrated

  • mir/passes.py: added ep_has_work_stealing(ep) helper (checks typed WorkStealing in ep.pragmas OR WSScope wrap in ep.pipeline). Concurrent-write predicate now reads through it.
  • codegen/cuda/{orchestrator,complete_runner,batchfile}.py: all op.work_stealing reads → ep_has_work_stealing(...) call.
  • sorted_array/lowerings/__init__.py:lower_scan_pipeline: unwraps trailing WSScope(InsertInto) while save/restoring ctx.ws_enabled=True — byte-equivalent by construction.
  • mir/print.py: added WSScope printer (unwraps to inner) so MIR s-expression goldens stay stable.
  • examples/polonius_test.py: migrated subset_trans from with_plan(work_stealing=True) to with_pragma(WorkStealing()).

D19 ratchet impact

  • DEAD CODE marker cap: 8 → 7 (atomic in same commit; C4 marker deleted)

Test plan

  • Byte-equivalence: test_byte_equivalence_jit (253) + test_runner_byte_equivalence (276 + 2 pre-existing skips) — all pass
  • test_pragma_work_stealing_end_to_end.py + WS plugin test + InsertInto byte-eq — green (rewritten to use typed pragma path)
  • D19 ratchets green at new cap
  • grep -rn "ep.work_stealing|ExecutePipeline.work_stealing" src/srdatalog/ → 0 hits (only docstring mentions + lowering-internal ctx.ws_enabled scratch flag remain)
  • Full suite: zero net regressions vs baseline (32 pre-existing local-env failures from prior jaccard install)
  • ruff check + format (CI v0.9.10): clean

Cross-PR conflict expectations

  • A3-1 (dedup_hash) + A3-3 (block_group, in flight): mechanical conflicts on dsl.py + mir/types.py tuple/field removals; D19 cap (each A3-* PR decrements by 1, so cap landing order needs alignment). Trivial unions.

🤖 Generated with Claude Code

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
StarGazerM force-pushed the feat/a3-2-remove-work-stealing-bool branch from 5be94d3 to 00e4386 Compare May 19, 2026 16:34
@StarGazerM
StarGazerM merged commit 23cdd32 into design/redesign-package May 19, 2026
2 of 3 checks passed
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