Skip to content

Run sanitizers by default on schema-v3 kernel tasks - #151

Open
irvineoy wants to merge 10 commits into
mainfrom
v3-sanitizers
Open

irvineoy wants to merge 10 commits into
mainfrom
v3-sanitizers

Conversation

@irvineoy

@irvineoy irvineoy commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Schema-v3 kernel tasks now run sanitizers by default, for every target
language, with no task configuration. A run config without an
evaluation_tools section runs the set in src/eval_tools/defaults.py on
MI355X (gfx950) under a new gated policy.

Tool Default Role Languages
page_fault_guard (new) on gate Triton, Gluon, HIP, FlyDSL, asm
csan (new, PyTorch CUDA Sanitizer) on gate all five
tilelens (new, symbolic OOB in the CPU interpreter, confirmed by a concrete rerun) on gate Triton (Gluon reported unsupported)
rocjitsu_waitcheck on gate all five
rocjitsu (race detector) on gate Triton, Gluon
triton_fpsan on signal Triton/Gluon candidate with a Triton/Gluon baseline
gpu_asan off gate HIP, Triton, Gluon; bare-metal hosts only

Multi-GPU tasks (#152) are recorded as unsupported by every tool; running the lanes through #152's rank launcher is a follow-up.

The change has three layers, and the sections below follow them, so it can be reviewed in that order:

  1. Tools and v3 adapters. The new tools and a v3 path for every tool. Each is usable on its own through an explicit evaluation_tools section.
  2. The gated policy and the score change. How a tool result decides whether performance is scored.
  3. The default set. What a run without an evaluation_tools section starts.

1. Tools and v3 adapters

  • v3 runner lanes. src/tools/arena_eval/sanitize.py adds python3 -m _aka_eval.evaluate {baseline|candidate} sanitize LANE with lanes page_fault_guard, csan, tilelens, bounds, fpsan, gpu_asan and capture. Each lane:

    • checks the environment its sidecar set;
    • runs the role on the task's own correctness cases;
    • prints one report.
  • Page-fault guard. It reruns correctness with PyTorch's caching allocator and ROCr's fragment allocator off, so a stray access reaches an unmapped page and faults.

    • An output that passed correctness but now fails it grossly is also a finding: a non-finite value, an error over 10 times the bound, or more than 1% of elements (and at least 8) over it.
    • A smaller excess is recorded as unverified, since split-K and atomic kernels vary that much from run to run.
    • A report whose cases failed in different ways (mixed) is judged by the kinds of its failed cases: an execution error does not turn a marginal mismatch into a finding.
  • TileLens confirmation. TileLens 3.1.1 is symbolic. It over-approximates loop-carried pointers and loaded indices, so on its own it flagged 13 clean production baselines.

    • A TileLens report now counts only when the bounds lane reproduces it. That lane reruns the same smallest case in Triton's interpreter and checks every active load, store and atomic address against the launch's argument buffers.
    • Otherwise the report is unverified.
    • The check reads the source, so an out-of-bounds address blocks even on a load whose value is unused or that the compiler removes. CANDIDATE.md says so.
  • HIP builds. The loader gains an allowlisted sanitizer flag and arch override (AKA_HIP_SANITIZER_CFLAGS, AKA_HIP_OFFLOAD_ARCH); both enter the build hash.

  • Framework adapters. src/eval_tools/plugins/aka_v3.py, v3_lanes.py and v3_tools.py give every tool a v3 path, so no task.yaml field is needed.

    • FpSan and GPU ASan keep their own environment and attestation rules and receive the lane as their command.
    • GPU ASan attests device instrumentation from the code object (__asan symbols), not from compiler metadata.
    • A language no tool is qualified on, and a multi-GPU task, is unsupported (unverified), never not_applicable.
  • Capture. Waitcheck and rocJITsu run the image-owned adapters/aka_v3_entrypoint.py. It captures the role's dispatched kernels on the GPU:

    • Triton/Gluon: each launch's HSACO, metadata, grid, arguments and memory before and after.
    • HIP: the extension's unbundled code objects.
    • FlyDSL: the embedded HSACO.
    • asm: every code object aka_asm handed to HIP, vendored or assembled.

    It then runs Waitcheck on every captured kernel and replays every Triton/Gluon launch as a rocJITsu capsule (adapters/aka_v3_capsules.py). A race from a replay that does not reproduce the GPU's output is unverified.

  • Images. New page-fault-guard, csan and tilelens images. TileLens 3.1.1 and the modules it imports are hash-locked and kept outside the base environment. Each tool image carries a SHA-256 of its Dockerfile and the checkout files it copies (com.amd.agent-kernel-arena.eval-tool-source).

2. The gated policy and the score change

  • ToolPlan gains a role (plan schema 3).
    • A gate blocks performance only on a definite finding.
    • A signal (FpSan) never blocks.
    • Unverified outcomes (unsupported, tool error, timeout, inconclusive) are recorded and never count as clean.
  • Baseline recheck. After a candidate finding the manager reruns the same tool on the task's baseline.
    • A finding that names a kernel or a location (Waitcheck, rocJITsu, TileLens) is excused (baseline_also_found) only when the baseline reports it in the same kernel at the same location. A finding with neither (a page fault, an allocator-sensitive output, a CSAN race) matches by kind.
    • TileLens locations are relative to the role's directory, so a candidate that copies the baseline reports the baseline's location.
    • The record lists the baseline's findings and the excused ones, and the run log names the excused kinds.
  • pass_tool_gate: false now scores zero (src/score.py).
  • Why this is safe as a default. The guide and the example config call the sidecar stage diagnostic, not a tamper-resistant reward boundary, because the sidecars run in the same phase as the agent. The gated policy stays within that: a finding can only withhold a score, never raise one, so a candidate that evades or interferes with a tool scores no higher than it would with the stage off. The docs now say this.

3. The default set

  • src/eval_tools/defaults.py is the single source of truth for the set, the roles and the policy; the runner and the config parser both read it.
  • docker_benchmark.sh:
    • resolves the default set through defaults.py, on gfx950 only, and not for a qa_auditor run, which never evaluates a candidate;
    • builds a missing default image on first use, rebuilds one whose source label differs from the checkout, and stops if a build fails; an image given through AKA_EVAL_TOOL_IMAGE_<TOOL> is used as given, with a warning when its label differs;
    • covers all nine tools in every list;
    • gives the Waitcheck sidecar the worker's GPU for capture.
  • evaluation_tools: false (or enabled: []) turns the stage off; an explicit section is used exactly as written.
  • Docs. The evaluation-tools guide, task authoring guide, MI355X runtime guide, CANDIDATE.md, AGENTS.md and release notes cover the defaults and roles, the per-lane coverage limits, the confirmation, gross-mismatch and baseline-matching rules, and why ConSan, HIP-FpSan and Triton's own consan/gsan modes are not enabled.

Validation

Review fixes (aa5b0ea4, 52b905ca, on a merge of main 8e7a7b32)

  • CPU (Linux container, Python 3.12, torch CPU): python -m pytest -q tests gives 2717 passed and 128 skipped; tests/test_docker_benchmark.sh passes. CI is green on aa5b0ea4.

  • MI355X, default path end to end on aa5b0ea4. docker_benchmark.sh parallel-run with a run config without evaluation_tools and a credential-free claude stand-in:

    • The node had none of the tool images. The first run built all six, each with the source label the runner computes for this checkout; the second run built nothing.
    • Behavior-preserving edits on Triton silu_and_mul, HIP sigmoid, Gluon gemm_a8w8 and FlyDSL softmax: 4/4 accepted, no gate finding.
    • An unused load one row past the Triton input: blocked by tilelens:finding:found, score 0.
  • MI355X, the tools through the manager on 52b905ca (one GPU, every default sidecar, baseline as the candidate unless seeded):

    Entry Result
    asm topk_softmax, gemm_a16w16, gemm_a8w8_blockscale, gemm_afp4wfp4 allowed; page-fault guard, CSAN and Waitcheck clean (Waitcheck on the vendored AITER code objects); rocJITsu unsupported; TileLens and FpSan not applicable
    asm topk_softmax plus a kernel that stores 64 MiB past topk_weights blocked by page_fault_guard (gpu-memory-fault)
    asm topk_softmax plus a kernel that reads a loaded VGPR before s_waitcnt vmcnt blocked by rocjitsu_waitcheck (wait-hazard-wait-counter); ordinary correctness passes
    Triton silu_and_mul near and far out-of-bounds stores blocked by page_fault_guard and tilelens; the TileLens finding names the kernel and kernel.py:61, and the baseline recheck is clean
    topk_topp_mask, kda_chunk_attention (rocJITsu VGPR race), prefix_prefill_attention_alibi (Waitcheck, _fwd_kernel_alibi at .text+0x2288) allowed: the baseline reports the same finding in the same kernel at the same location, and the record lists it as excused
    kda_chunk_kkt allowed; rocJITsu clean on this run (it reported an LDS race in the original campaign)

    An earlier run of this set on 68a6c8fd found that the TileLens sidecar's startup control did not pass after the location change, so TileLens was unavailable (recorded, not blocking). 52b905ca fixes it and adds regression tests.

  • Follow-up jobs on the nodes found no container or temp directory left by these runs.

  • Not run on GPU: rebuilding an image with an old label (shell test only), a multi-GPU task (none on main), and the mixed rule (unit tests).

Original revision (55e4e547)

CPU

  • tests/eval_tools/test_v3_sanitizers.py (54) and tests/test_arena_eval_sanitize.py (16) are new and pass.
  • The existing eval-tools, arena-eval, score, task-contract and evaluator suites pass, apart from 21 failures that main shares on the same macOS host.
  • make check-perf-helpers passes.
  • tests/test_docker_benchmark.sh fails at the same GEAK check on this branch and on main on a host without a python executable. The DeepSeek image check passes; this change had to adapt it because defaults now start sidecars.

Startup controls and images

  • Every sidecar runs its positive controls before it accepts work: a safe probe must be clean and a seeded probe must be found. For TileLens, the symbolic check and the concrete bounds check must agree on both an in-bounds copy and an off-by-one copy.
  • All nine sidecar images build from the repository on gfx950. The first build takes about 22 minutes, and later runs reuse them. The rocJITsu images install a pinned GCC from the Ubuntu toolchain PPA.

GPU ASan, bare-metal MI355X host

Checked with both ordinary and hardened container flags:

  • HIP standalone, HIP torch extension, Triton with buffer ops off, and Gluon gl.load/gl.store: the safe probes are clean, and the seeded out-of-bounds probes report heap-buffer-overflow.
  • Triton buffer ops and Gluon explicit buffer ops escape ASan, as documented.

Full campaign, virtualized MI355X cluster

Every schema-v3 task (379) ran its baseline as the candidate through the manager, with the default set under gated. Six seeded out-of-bounds variants were added: Triton, HIP, Gluon and FlyDSL, near and far. Total: 385 entries.

Tool Triton (278) Gluon (7) HIP (38) FlyDSL (55) Seeded (6)
page_fault_guard 277 clean, 1 false positive (fixed, below) 7 clean 38 clean 55 clean 6/6 found (GPU memory fault)
csan 278 clean 7 clean 38 clean 55 clean unverified (the seeded fault ends the process)
tilelens 177 clean, 84 unanalyzable, 4 no report, 13 reports (none confirmed, below) unsupported n/a n/a Triton 2/2 found and confirmed
triton_fpsan (signal) 276 equivalent, 1 mismatch, 1 process failure 7 equivalent n/a n/a Triton near: mismatch
rocjitsu_waitcheck 231 clean, 46 unverified, 1 finding 7 clean 30 clean, 8 unverified 55 clean 3 clean, 3 unverified (capture faulted)
rocjitsu 117 clean, 158 unverified, 3 findings 7 unverified unsupported unsupported Triton near clean; Triton far and Gluon near unverified
  • Gating.

    • Every seeded variant was blocked; the baseline recheck was clean each time.
    • The clean baselines were all allowed apart from one false positive, now fixed: 378 of 379 on this run, and 379 with the fix.
    • The one TileLang-baseline task is not exercised: no target language matches its baseline, so its candidate stays the template and every tool reports an execution error.
  • Median cost per clean baseline, by tool:

    • page_fault_guard: 24 to 27 s.
    • csan: 3.6 to 10.9 s.
    • rocjitsu_waitcheck: 3.5 to 11 s.
    • rocjitsu: 5.3 s.
    • triton_fpsan: 3.6 s.
    • tilelens: 2.4 s.
    • A TileLens confirmation adds a median 2.5 s (90th percentile 17 s, maximum 243 s).
  • Unverified on clean Triton baselines.

    • rocJITsu: 57%. Mostly partial capsule replays (135), then launches it did not analyze (18) and capture failures (5).
    • TileLens: 36%. That is 84 kernels the interpreter cannot run, 4 missing reports, and the 13 unconfirmed reports.
    • Waitcheck: 17%.

    These record, but do not block. They mark where the default set gives no assurance.

Fixes from this campaign, all with regression tests:

  • FlyDSL split-K GEMM (earlier run). The page-fault guard reported it as allocator sensitive because one element came out 14% over its bound, which is ordinary run-to-run variation. Only a gross output change now counts.
  • Triton layer_norm bf16_d256. Its mean output for a one-row case is a single element, 11% over the bound. That counted as 100% of elements over it. The fraction rule now needs at least 8 elements over the bound; the run's own report is judged unverified under the new rule.
  • Baseline recheck. It excused a candidate finding only when the baseline reported the same kinds. The review fixes below tighten this to the same kernel and location.
  • TileLens. The 13 reports on clean baselines are why the concrete confirmation was added.

TileLens confirmation and concrete bounds check

Run on the TileLens commit with the default images.

  • Seeded Triton variants. Near and far are both confirmed and blocked.
  • Clean baselines TileLens had flagged. Of the 13, 7 ran through the manager; each is now unverified. The concrete rerun reproduced nothing on 6; on 1, the interpreter does not support a dtype. The other 6 are covered by the sweep below: 5 reproduced nothing and 1 is unanalyzable. None is confirmed.
  • Concrete sweep over every clean Triton baseline (278).
    • 232 have no out-of-bounds access, and 45 cannot run in the interpreter.
    • One has a real one, unified_attention bf16_q8_kv4_d256_p16_swa1024:
      • The vendored vLLM kernel uses 32-slot tiles over 16-slot pages for this Gemma 3 configuration, and loads the block-table entry for every slot of a tile without a mask.
      • With a block table sized exactly to the sequence, it reads one int32 past the end.
      • The value feeds only masked K/V loads, so outputs are unaffected.
    • TileLens cannot analyze that kernel and records it as unverified. The concrete check runs only to confirm a TileLens report, so nothing blocks it.

End to end

  • QA path. make docker-run with qa_auditor over 10 tasks (Triton, Gluon, HIP and FlyDSL), with the default set resolved and its images built: 10/10 QA PASS. The QA auditor finishes before tool evaluation, so this shows only that the defaults do not disturb the QA path.

  • Agent path. main.py through docker_benchmark.sh parallel-run, with a run config that has no evaluation_tools section. The agent is a credential-free stand-in for the claude CLI that makes a fixed edit. It covers one task per target language: Triton silu_and_mul, HIP sigmoid, Gluon gemm_a8w8 and FlyDSL softmax.

    • Behavior-preserving edit, run twice: 4/4 accepted with pass_tool_gate: true both times.
      • Triton: all six default tools are clean.
      • HIP and FlyDSL: the page-fault guard, CSAN and Waitcheck are clean; TileLens and FpSan are not applicable, and rocJITsu is unsupported.
      • Gluon: everything is clean except TileLens (unsupported) and rocJITsu (unverified).
    • The campaign's seeded out-of-bounds writes: 4/4 rejected. The candidate's correctness process died before reporting, already with the ordinary allocators, so correctness failed and the tools never ran.
    • Unused out-of-bounds Triton load. The edit adds one unused load, one row past the end of the input. Correctness passes, and the GPU-side tools see nothing, because the value is never used.
      • The candidate is rejected with pass_tool_gate: false, blocked by tilelens:finding:found, and scores 0.
      • The finding is the concrete confirmation: loads outside every argument buffer, at the added line. The TileLens baseline recheck was clean.
      • The other five tools are clean.

    All three runs used the final commit.

Findings on clean baselines, not triaged

The baseline recheck excuses these, because the same finding is reported on the baseline. They are reported here rather than fixed in this PR:

  • rocJITsu reports a VGPR race on topk_topp_mask f32_v151936 and on kda_chunk_attention bf16_h12_d128, and an LDS race on kda_chunk_kkt bf16_h32_k128_c64.
  • Waitcheck reports a missing s_waitcnt vmcnt on prefix_prefill_attention_alibi.
  • FpSan, a signal only, reports a semantic mismatch of ff_a16w16_fused_gated against itself.
  • The concrete check found the unified_attention block-table read above.

Not covered

  • Multi-GPU tasks (Add sgl-amd-mono monokernel tasks, multi-GPU kernel tasks and a compare decode hook #152). Every tool records them as unsupported. The page-fault guard, CSAN and the Waitcheck capture could run per rank through Add sgl-amd-mono monokernel tasks, multi-GPU kernel tasks and a compare decode hook #152's launcher; TileLens and rocJITsu cannot model peer-memory access. That is a follow-up once Add sgl-amd-mono monokernel tasks, multi-GPU kernel tasks and a compare decode hook #152 merges.
  • rocJITsu on asm. Assembly launches are not captured as replay capsules yet.
  • GPU ASan campaign. GPU ASan cannot run on virtualized MI355X hosts. With HSA_XNACK=1 a GPU access to malloc() memory faults there, and so does the ASan runtime's heap-initialization kernel. It stays opt-in for bare-metal hosts. A GPU ASan campaign over every baseline on a bare-metal host did not get a host in time; only its probes above ran.
  • gfx942 remains unverified, and the runner keeps the stage off there.
  • Image builds need the network. After a change to src/eval_tools, every default image is rebuilt on its next use. A host that cannot reach the package indexes stops the run instead of running old tool code; one validation node failed this way.
  • Killed runs. A run killed before its exit handler finishes leaves its sidecar containers running; a scheduler cancel during validation did exactly that. Sidecars are named aka-eval-<run label>-<tool>-<pid> and need docker rm -f; reaping them at the start of a run is a follow-up.
  • Integrity boundary. The capture runs in the same process as the candidate, guarded by the evaluator's integrity snapshot. The same-phase agent/evaluator boundary and resume freshness documented in the guide are unchanged.

A run config without an evaluation_tools section now runs the page-fault
guard, PyTorch CSAN, TileLens, rocJITsu Waitcheck, the rocJITsu race
detector and Triton FpSan on every schema-v3 task on gfx950, for any
target language and with no task configuration. GPU ASan is supported
for HIP, Triton and Gluon but stays opt-in: it needs a bare-metal host.

- The v3 runner gains `evaluate {baseline|candidate} sanitize LANE`.
  Each lane checks the environment its sidecar set and runs the role on
  the task's correctness cases. A capture lane records the dispatched
  kernels for Waitcheck and rocJITsu replay capsules.
- Every tool gets a framework-owned v3 adapter, so task.yaml needs no
  adapter fields.
- The new gated policy gives each tool a gate or signal role. A gate
  blocks performance only on a definite finding that the baseline,
  rechecked with the same tool, does not share. Unverified results are
  recorded but never count as clean. A blocked tool gate scores zero.
- The runner resolves the default set, builds missing default images
  and gives the Waitcheck sidecar the worker's GPU.
- Before building an evaluation-tool image, pull each pinned BASE_IMAGE
  and BUILDER_IMAGE through the Docker daemon, which BuildKit then uses
  locally. On hosts whose registry TLS only the daemon trusts, BuildKit
  otherwise fails to fetch the rocJITsu builder image.
- The CSAN startup control imports torch._dynamo, whose cache path calls
  getpass. Give the new probes and lanes USER, LOGNAME and an inductor
  cache directory, because a sidecar UID need not exist in passwd.
A first hardware campaign over 24 schema-v3 baselines and seeded
out-of-bounds variants showed five ways the v3 lanes misreported:

- rocJITsu reported LDS races on two clean baselines from replays that
  did not reproduce the GPU's output. A race from a replay that was not
  attested (dispatch, capsule and golden output) is now inconclusive.
- Waitcheck required a code object to hold exactly one kernel, so every
  HIP extension with two kernels was partial. The entry point now
  records the inventory size and the parser expects it.
- FpSan and the Triton GPU ASan check looked up `<symbol>.hsaco`, which
  does not exist for `@triton.jit(repr=...)` kernels: Triton names the
  cache files after the Python function. The code object is now the
  metadata file's sibling.
- FlyDSL capture recorded nothing: a launch reaches the compiled
  artifact through executor methods, not `__call__`. The observer now
  watches FlyDSL compiler frames, and MLIR string literals are decoded
  with all their escapes.
- TileLens 3.1.1 failed on all Gluon kernels tried, so Gluon is now
  reported unsupported instead of being run.
The safe step read a tensor on a side stream without waiting for the
default-stream write that produced it, which is a real race, so CSAN
correctly rejected it and the sidecar never became ready. The side
stream now waits for the default stream before the read, as the
default stream already waited for the side stream after it.

On MI355X the safe step now exits 0 with no report and the race step
reports the race.
The campaign over all 385 schema-v3 entries blocked one clean baseline:
the page-fault guard reported a FlyDSL split-K GEMM as allocator
sensitive because one element of one case came out 14% over its
baseline-relative bound. That is ordinary run-to-run variation, and the
same check passed on the baseline recheck.

- The guard now reports an output change only when it is gross: a
  non-finite value, an error over 10 times the bound, or more than 1% of
  elements outside it. Reading memory the role does not own produces
  values like that. A smaller excess is recorded as unverified.
- The baseline recheck now excuses a candidate finding only when the
  baseline reports the same kinds. A baseline finding of another kind no
  longer hides, for example, a candidate fault.
- The docs say that the first run builds the default images over the
  network and stops if a build fails.
TileLens checks Triton kernels symbolically and over-approximates
loop-carried pointer updates and loaded indices. On the MI355X campaign
it reported out-of-bounds accesses on clean production baselines, for
example the cyclic K loop of ff_a16w16_fused_gated, which stays in
bounds. As a gate it would block a correct candidate that uses the same
pattern on a task whose baseline does not.

A TileLens violation now triggers the new `bounds` lane in a fresh
process: the same smallest case runs concretely in Triton's CPU
interpreter (TRITON_INTERPRET=1), and every active load, store and
atomic address is checked against the argument buffers of its launch.
A stray access is recorded and masked off instead of performed. Only a
reproduced access is a finding; otherwise the result is unverified
(tilelens_unconfirmed).

The TileLens startup control also runs the concrete check on the safe
and off-by-one copies, so a broken check fails the control instead of
silently disabling the gate. The image copies the lane module for that.
The full MI355X campaign blocked one clean baseline, Triton layer_norm
bf16_d256: its per-row mean for a one-row case missed the bound by 11%
once with the allocators off. One element is a 100% violation fraction,
so the gross-mismatch rule took it for a finding, and the baseline
recheck happened to pass.

The fraction rule now also needs at least 8 elements outside the bound.
Non-finite values and errors over 10 times the bound stay gross at any
size. The recorded lane report of that run is now judged unverified.
@irvineoy
irvineoy marked this pull request as ready for review November 11, 2026 15:30

@jhinpan jhinpan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Request changes. I reviewed 55e4e547 and tested the default path on 8x MI355X (gfx950). For single-GPU tasks, the results agree with the description. Three problems affect the gate: the multi-GPU tasks of #152, the mixed failure kind, and the baseline recheck.

What passed on MI355X

I used a run config without evaluation_tools and the claude_code agent. A stand-in CLI made one fixed edit. The host did not have the two rocJITsu images, and the runner built them on first use (8 min).

Task Candidate Result
Triton silu_and_mul/bf16_d4096 baseline copy Allowed. All 6 tools are clean.
HIP sigmoid/f32 baseline copy Allowed. page_fault_guard, csan and Waitcheck are clean.
FlyDSL softmax/f32_n4096 baseline copy Allowed. page_fault_guard, csan and Waitcheck are clean.
Gluon gemm_a8w8/n4096_k4096 baseline copy Allowed. TileLens does not support Gluon, and rocJITsu is inconclusive. The other 4 tools are clean.
Triton silu_and_mul/bf16_d4096 reads 2 bytes past the input Correctness fails with a GPU memory fault. The tools do not run.
Triton silu_and_mul/bf16_d4096 unused load one row past the input tilelens:finding:found blocks it. The score is 0.

Blocking

1. The default sanitizers do not run on the multi-GPU tasks of #152.

I merged this PR into #152 and kept both changes in the two conflicts. Then I ran the baseline copy of other/deepseek_v41_flash_attention_front/tp4.

  • page_fault_guard and csan failed all 9 cases with AttributeError: 'NoneType' object has no attribute 'items'. The Waitcheck capture failed with the same error.
  • Cause: a lane calls the operator in one process, without a rank (sanitize.py#L168-L173, sanitize.py#L123-L135). For a multi-GPU task, make_inputs then returns kernel=None (values.py#L168-L169 in #152).
  • The plugins record inconclusive, and the gate allows the candidate. Thus a multi-GPU task gets no sanitizer check, but CANDIDATE.md tells the agent that the sanitizers run.
  • The CPU tests pass on the merged tree. No test covers this case.
  • Fix: run the lanes through the rank launcher of #152. Or return unsupported for a distributed contract in _v3_engine (v3_lanes.py#L38-L62). Add a test.
  • If #152 merges first, this PR must make the change. If this PR merges first, #152 must make it.

2. The mixed failure kind skips the gross-mismatch rule (v3_lanes.py#L162-L171).

I called PageFaultGuardPlugin.parse with three lane reports:

Lane report Result
One marginal mismatch inconclusive
One execution error without a fault inconclusive
Both together (mixed) found: the gate blocks the candidate, and the score is 0

Fix: judge mixed by its parts.

3. The baseline recheck compares only the kind of finding (manager.py#L534-L543).

  • If the baseline has a finding of one kind, the gate excuses each candidate finding of that kind. It also excuses a new race or OOB at a different location.
  • The description lists baselines with such findings, for example topk_topp_mask and prefix_prefill_attention_alibi.
  • Fix: compare the kind, the kernel and the location. Or list the excused findings in the report.

Decisions for maintainers

4. An unused load sets the score to 0. The blocked load in the last row of the first table is not in the GPU code. For gfx950, that variant has the same number of loads as the baseline: 2 in TTGIR and 8 in AMDGCN. A variant that uses the load has 3 and 12. TileLens and the bounds lane run each load in the CPU interpreter. If a source-level OOB must block, write this in CANDIDATE.md. If not, ignore findings on a load whose value the kernel does not use.

5. The default gate uses a boundary that the repository calls diagnostic. The example config says that the sidecar stage is "diagnostic rather than a tamper-resistant reward boundary" (evaluation_tools_advisory_mi355x.yaml#L17-L18). This PR makes it a default gate that sets the score to 0 (score.py#L144-L147). src/score.py needs approval from @sinarafati-amd (CODEOWNERS#L16).

Other items

6. The sidecars can run old code. ensure_eval_tool_image checks only that the fixed tag exists (docker_benchmark.sh#L1196-L1206). Each image contains a copy of src/eval_tools (Dockerfile#L9). The sidecar worker and the Waitcheck and rocJITsu entrypoint run from that copy (v3_tools.py#L43). After a source change, the host keeps the old copy, and no message tells the user. Fix: put a hash of the copied files in the tag, or compare an image label at startup.

7. The defaults also start for QA runs. runner_selection does not look at the agent (defaults.py#L57-L60). Thus a QA-auditor run also starts six sidecars. On a new host, it first builds the images.

8. Style (SGLang rules).

Not tested: gfx942, GPU ASan on bare metal, and the 379-task campaign.

How I tested
  • Node: smci355-ccs-aus-n07-05, 8x MI355X. Image: lmsysorg/sglang@sha256:e2084966….
  • I ran one job at a time. Before each job, each GPU was idle in 10–20 samples. Each GPU stayed locked during the job.
  • I built the four small images by hand (2 min). The runner built rocjitsu and rocjitsu-waitcheck on first use.
  • The stand-in CLI answers --version and auth status, makes the edit, and prints one result event. HOME pointed to a new directory that holds only the stand-in, so the run used no credentials.
  • mixed: a call of PageFaultGuardPlugin.parse with the report helpers of tests/eval_tools/test_v3_sanitizers.py.
  • Load count: triton.compile(ASTSource(...), target=GPUTarget("hip", "gfx950", 64)) for each variant. I counted tt.load in TTGIR and global_load* in AMDGCN.

- Every v3 tool reports a multi-GPU task (a contract world_size above 1)
  as unsupported: a lane calls the operator once in one process without a
  rank. CANDIDATE.md now says the sanitizers run on single-GPU tasks.
- The page-fault guard judges a mixed report by its failed cases. An
  execution error no longer makes a marginal mismatch gross.
- A baseline check lists the baseline's findings and, when it excuses the
  candidate, the excused findings; the evaluator logs the excused kinds.
- A tool image is labelled with a digest of its Dockerfile and the checkout
  files it copies. The runner rebuilds a default image whose label differs
  and warns about an overridden one.
- A qa_auditor run starts no default tools.
- Waitcheck, rocJITsu and GPU ASan report a language no tool is qualified
  on (asm) as unsupported instead of not applicable, like the other lanes.
- Style: plugins declare baseline_check (now part of ToolPlugin); the GPU
  ASan constants move to adapters/hip_source.py, which removes the import
  cycle that forced mid-module imports; the sidecar worker uses the
  shared fault pattern and allocator settings; the runner drops an
  always-true conditional; the gated log names its policy and blocking
  findings.
- A baseline recheck excuses a candidate finding only when the baseline
  reports it in the same kernel at the same location. Findings with
  neither (a page fault, an allocator-sensitive output, a CSAN race) still
  match by kind.
- The bounds lane records TileLens locations relative to the role's
  directory, so a candidate that copies the baseline reports the
  baseline's location; before, a baseline rerun recorded none.
- asm candidates get the page-fault guard, CSAN and Waitcheck: capture
  writes every code object aka_asm handed to HIP. rocJITsu (no capsule
  capture for asm launches) and GPU ASan (no instrumentation) report asm
  unsupported.
- CANDIDATE.md states that an out-of-bounds address in the Triton source
  blocks, even on a load the compiler removes.
- The docs and the advisory example config state that the gated default is
  a scoring gate: a finding can withhold a score but never raise one.
@irvineoy

Copy link
Copy Markdown
Collaborator Author

@jhinpan thanks for the careful review and the MI355X runs. The fixes are in aa5b0ea4 and 52b905ca, on top of a merge of current main. I rewrote the PR description to follow the three layers you named.

Blocking

1. Multi-GPU tasks. Every v3 tool now reports a task whose contract has a world_size above 1 as unsupported (<tool>_multi_gpu_unsupported).

2. mixed. The page-fault guard now judges a mixed report by the kinds of its failed cases, and the gross-mismatch rule looks only at numerical_mismatch cases. Your three reports now all give inconclusive. A gross mismatch or an input mutation is still a finding, whatever else failed. Test: test_page_fault_guard_judges_a_mixed_report_by_its_cases.

3. Baseline recheck. A candidate finding is now excused only when the baseline reports it in the same kernel at the same location.

  • This applies to findings that carry a kernel or a location: Waitcheck, rocJITsu and TileLens. A finding with neither (a page fault, an allocator-sensitive output, a CSAN race) still matches by kind.
  • The record lists the baseline's findings and the excused ones, and the run log names the excused kinds.
  • TileLens locations are now relative to the role's directory. Before, a baseline rerun recorded no location at all.
  • On MI355X, a copy of topk_topp_mask, kda_chunk_attention and prefix_prefill_attention_alibi is still excused: the same kernel, at the same offset.

Decisions for maintainers

4. Unused loads. We keep blocking. An out-of-bounds address in the source is undefined behavior, and a different compiler version or target can keep the load. CANDIDATE.md and the guide now say that the bounds check reads the Triton source, so it blocks even on a load whose value is unused or that the compiler removes.

5. Default gate. We keep gated as the default. It is a scoring gate, not a security boundary: a finding can withhold a score but never raise one. A candidate that evades or interferes with a tool therefore scores no higher than it would with the stage off. The guide and the advisory example config now say this alongside the existing "diagnostic" wording. @sinarafati-amd, could you review the src/score.py change (pass_tool_gate: false scores zero)?

Other items

  • 6. Stale images. A build now labels each tool image with a SHA-256 of its Dockerfile and every checkout path the Dockerfile copies (com.amd.agent-kernel-arena.eval-tool-source).
    • The runner compares that label with the checkout before it starts a sidecar, and rebuilds a default image built from other sources.
    • An image named by AKA_EVAL_TOOL_IMAGE_<TOOL> is used as given, with a warning.
    • Covered in tests/test_docker_benchmark.sh.
  • 7. QA runs. A qa_auditor run without an evaluation_tools section starts no default tools; an explicit section still applies.
  • 8. Style.
    • The if true; then is gone.
    • baseline_check is part of ToolPlugin, every plugin declares it, and the manager reads it directly.
    • The mid-module imports were there because of an import cycle: adapters/hip_source.py imported the GPU ASan constants from the plugin. The constants now live in adapters/hip_source.py, and the imports are at the top.
    • The worker uses aka_v3.FAULT_RE and aka_v3.NO_CACHING, so there is one copy of each.
    • The evaluator log names the policy and the blocking findings.
  • Scope. This stays one PR, by my decision: splitting it would mean validating each step on GPU separately. The description now follows your three steps (tools and v3 adapters, the gated policy and score change, the default set), so it can be read in that order.

Also new since main gained asm (#148): asm candidates now get the page-fault guard, CSAN and Waitcheck. The capture analyzes every code object aka_asm hands to HIP. rocJITsu and GPU ASan report asm unsupported.

Validation

  • CPU (Linux container, Python 3.12, torch CPU): python -m pytest -q tests gives 2717 passed and 128 skipped, and tests/test_docker_benchmark.sh passes.
  • MI355X, default path end to end on aa5b0ea4, with a run config without evaluation_tools and a credential-free claude stand-in:
    • The node had none of the tool images. The first run built all six with the label the runner computes; the second run built nothing.
    • Behavior-preserving edits on Triton, HIP, Gluon and FlyDSL tasks: 4/4 accepted.
    • Your unused-load variant is blocked by tilelens:finding:found, score 0.
  • MI355X, the tools through the manager on 52b905ca:
    • Four asm baselines are clean.
    • An asm far store is blocked by the page-fault guard.
    • An asm missing vmcnt wait is blocked by Waitcheck, while ordinary correctness passes.
    • Triton near and far stores are blocked by the page-fault guard and TileLens, with a relative location and a clean baseline recheck.
    • The three shared baseline findings above are excused.
  • Caught on the way: a run on 68a6c8fd showed the TileLens startup control failing after the location change. The tool was recorded as unavailable and blocked nothing. 52b905ca fixes it, with regression tests.
  • Not run on GPU: rebuilding an image with an old label (shell test only), a multi-GPU task, and the mixed rule (unit tests).

@irvineoy
irvineoy requested a review from jhinpan November 20, 2026 07:38

@jhinpan jhinpan left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@irvineoy Updated: I removed the requests that had no proven cause. At 52b905ca my earlier requests are fixed. I reverted five of the fixes one at a time, and the matching new test failed each time (CPU, test_v3_sanitizers.py and test_score.py). Two problems remain. Both come from the default selection. I traced them on CPU. I did not run Docker or a GPU.

  1. Serving runs stop at start. example_configs/e2e_qwen3_codex_mi355x.yaml, e2e_qwen3_next_80b_codex_mi355x.yaml and e2e_qwen3_smoke_mi355x.yaml have no evaluation_tools section. python3 src/eval_tools/defaults.py select <config> gfx950 returns the six default tools for them. start_eval_tool_sidecars then calls verify_eval_tool_scoring_image, which stops the run when the image is not the pinned one. These configs use the serving lock images (sha256:b435b508… and sha256:7a3087bc…), not the pinned sha256:e2084966…. On main they select no tool. Fix: select no default tool for a run that has no schema-v3 kernel task, and add a runner test for a serving config.
  2. quality_loop rejects every candidate that is not Triton. agents/quality_loop/orchestrator.py (lines 153, 436, 759) needs tool_policy_satisfied. With the defaults under gated, a clean HIP, FlyDSL or asm candidate gets rocjitsu:capability:unsupported, and a clean Gluon candidate gets tilelens:capability:unsupported. The flag is then false. Fix: read pass_tool_gate there, or keep the defaults off for quality-loop.

The branch also conflicts with main in docs/reference/release-notes.md (from #150).

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.

2 participants