Skip to content

[FEAT] [Race Detector] Demo#271

Draft
mark14wu wants to merge 24 commits intomainfrom
feature/race_detector
Draft

[FEAT] [Race Detector] Demo#271
mark14wu wants to merge 24 commits intomainfrom
feature/race_detector

Conversation

@mark14wu
Copy link
Collaborator

Detects WAW/RAW races between thread blocks by recording Load/Store/Atomic accesses and comparing overlapping addresses across blocks.

Detects WAW/RAW races between thread blocks by recording Load/Store/Atomic
accesses and comparing overlapping addresses across blocks. Atomic-only
overlaps are correctly excluded.
@mark14wu mark14wu changed the title [FEAT] Race Detector Demo [FEAT] [Race Detector] Demo Feb 12, 2026
mark14wu and others added 8 commits February 12, 2026 18:57
Replace the concrete-only race detector with a symbolic-first approach:
run one representative block symbolically to build Z3 address expressions,
then use an SMT solver to check if two different blocks can access
overlapping memory. Falls back to concrete execution with inverted-index
detection for kernels with data-dependent addresses (e.g., histogram).

Key changes:
- Add SymbolicMemoryAccess dataclass in data.py
- Rewrite race_detector.py with op overriders for all op types, Z3
  cross-block checking, and concrete fallback with dynamic overrider
  disabling
- Fix ConstSymbolicExpr.concretize() in symbolic_engine.py to handle
  multi-element TensorHandles created by replace_subtree("load")
…detector

SymbolicSanitizer and RaceDetector shared ~500 lines of duplicated code:
operation overrider functions, numpy-to-symbolic-op mappings, RangeWrapper,
and for-loop callback infrastructure. This extracts the shared code into a
SymbolicClient(Client) base class in symbolic_engine.py, with subclass hooks
(_on_data_dependent_value, _should_skip_loop_hooks, _loop_hook_before/after)
for domain-specific behavior.
…olic_engine

Move shared symbolic operation overriders and for-loop infrastructure
from Sanitizer into a new SymbolicClient base class in symbolic_engine.py.
This enables other symbolic clients to reuse the common logic without
duplicating code.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@mark14wu mark14wu changed the base branch from main to refactor/symbolic-client February 17, 2026 04:18
mark14wu and others added 6 commits February 16, 2026 23:18
… base class

Move _op_atomic_cas_overrider and _op_atomic_rmw_overrider into
SymbolicClient since they are generic value-to-SymbolicExpr conversions
with no sanitizer-specific logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…olic_engine

Move shared symbolic operation overriders and for-loop infrastructure
from Sanitizer into a new SymbolicClient base class in symbolic_engine.py.
This enables other symbolic clients to reuse the common logic without
duplicating code.
… base class

Move _op_atomic_cas_overrider and _op_atomic_rmw_overrider into
SymbolicClient since they are generic value-to-SymbolicExpr conversions
with no sanitizer-specific logic.
Move _op_raw_load_overrider and _op_raw_store_overrider from sanitizer
into SymbolicClient since they are identical delegation methods that any
symbolic client will need.
@mark14wu mark14wu force-pushed the refactor/symbolic-client branch from 325c6ec to 8d9a3ba Compare February 17, 2026 04:48
Base automatically changed from refactor/symbolic-client to main February 19, 2026 03:25
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

Comments