Repository navigation
review-pr: correct FlyDSL D10/D10b and add D13/D14 from review outcomes - #7227
Conversation
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
One backend per PR: PR title tags & labels: |
READY FOR HUMAN REVIEWPR Self-ReviewRevision Author self-review accepted. Readiness report: Author answers
Show the author's self-review answersBehavior and intentValidation and unverified scopePR-specific questionChanged op testsPR state
Copilot findings
Code and op-test hygiene
Required CI
Shadow mode reports what would block but keeps the status successful. Set |
D10 asserted that flyc.compile does not execute and asked for cf(*args) on the cache-miss branch. FlyDSL 0.4.0 and 0.4.1 launch on compile with live arguments (verified on MI355X, and asserted by FlyDSL's own tests), so the rule fired on tensor_shim._run_compiled and its fix launched twice. D10 now covers the real hazards: a double launch, no launch with placeholder arguments or under COMPILE_ONLY, and a dispatching preload. D10b asked for arith.unwrap() around raw arith.bitcast. It now asks for the typed fx form instead of raw arith dialect ops, which are not stable API. D13 (compiled-handle cache key) and D14 (raw-pointer launch contract) come from bugs human reviewers found in the last month; D13 was reproduced on MI355X. The refuter prompt gains the FlyDSL facts behind recurring false positives. Step 7's LDS facts point at chip_info (gfx950 is 160 KiB). Co-Authored-By: Claude <[email protected]>
a1aa78b to
eb7dfa2
Compare
Co-Authored-By: Claude <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
D14 misses wrapper-only raw-pointer launch changes because it is selected only by flydsl-kernel; the general flydsl mapping and a wrapper-only regression case need updating.
1 open issue
What changed in this PR
This PR updates aiter’s review tooling to reduce FlyDSL false positives and detect compiled-handle cache and raw-pointer contract bugs. It complements #7226 without changing the C5 guidance or kernel implementations.
Changes:
- Corrects D10 compile-and-launch guidance and D10b raw-operation recommendations.
- Adds D13/D14 checks and updates rule selection and the generated mapping.
- Refreshes LDS guidance and adds FlyDSL-specific checks for rejecting false findings.
| File | Description |
|---|---|
.claude/skills/review-pr/triage.py |
Adds D13/D14 to rule-selection lists. |
.claude/skills/review-pr/SKILL.md |
Corrects LDS capacities and footprint guidance. |
.claude/skills/review-pr/rules.md |
Revises D10/D10b, adds D13/D14, and removes a stale test count. |
.claude/skills/review-pr/prompts/refuter.md |
Adds FlyDSL facts for checking potential false positives. |
.claude/skills/review-pr/MAPPING.md |
Updates the generated family-to-rule mapping. |
Review effort: Balanced
Raw-pointer launches live in aiter/ops/flydsl/*.py, which derive the flydsl family but not flydsl-kernel. Add D14 to flydsl, regenerate MAPPING.md, and add a wrapper-only derivation case to selftest.sh. Co-Authored-By: Claude <[email protected]>
|
@aiter-bot review |
|
aiter-bot — queued behind 1 review(s); expect to start in about 28 min. The box reviews one PR at a time. |
|
Checked this against #7226 and the merged result holds up — the two do not conflict, and The D10 correction is the part I'd call out as worth having: carrying the One gap, and it is not caused by this PR so much as widened by it. hit("flydsl-kernel", "A1 A4 B8 D1 D8 D12 D13 D14 P6 C5")
hit("flydsl", "D10 D10b D12 D13 D14 C5")but neither appears in It is mild, because ATOM's port of this skill carries a selftest for precisely this, added during the port: which is why the drift is visible there and not here. Worth bringing back upstream — adding a rule and forgetting to register it would then turn the suite red on the spot rather than silently shrinking the fallback. Happy to send that as its own small PR (the ten ids plus the guard) if you would rather not grow this one; you are in this file already, so whichever is less work for you. |
@yhl-amd — please take a look. Triage: if GLM serves but its output is malformed it may be the ATOM framework (@valarLip); if the box, GPU, disk or network is unhealthy it may be the machine (@gyohuangxin). Re-comment |
…omits (#7708) `derive()` can emit sixty rule ids; `ALL_RULES` listed fifty-eight of them. Missing: `B8`, `D12` (arrived with #7227) and `HK4`-`HK11`, which had been absent for longer. It is a quiet gap because ALL_RULES is read in only four places, and normal derivation does not touch it -- `B8` and `D12` expand correctly today. But those four places are the derivation-failed, diff-too-large and underivable fallbacks, plus the `rules=N/M` denominator. The fallbacks hand the worker the whole catalogue precisely when the deriver could not narrow it, which is the moment a short catalogue costs most: a diff too large to derive was being reviewed against a list missing ten rules, and nothing said so. The ids are added beside their families, and MAPPING.md regenerated. The second half matters more than the list. ROCm/ATOM's port of this skill carries a selftest comparing the two sets, added during that port; it is why the drift was visible there and not here. Ported back: t "every id derive() emits is in ALL_RULES" Removing `B8` from ALL_RULES now fails it with `missing:B8` rather than passing. Adding a rule and forgetting to register it stops being silent. Worth recording how close this came to looking verified: the first attempt at that regression check edited the first ` B8 ` in the file, which is prose in an unrelated help string, and the suite stayed green -- a test that proved nothing while appearing to prove the guard worked. The check above edits ALL_RULES itself. selftest 143 green / 0 red, 0 drift, MAPPING.md matches. Co-authored-by: zufayu <[email protected]> Co-authored-by: Claude Opus 5 (1M context) <[email protected]>


Companion PR: #7226 updates the Copilot FlyDSL instructions,
aiter-op-testand C5, and addsaiter/ops/flydsl/AGENTS.md. This PR leaves the C5 block alone.Summary
Corrects two FlyDSL rules in aiter-bot's
review-prthat fire on correct code, and adds two FlyDSL rules taken from bugs human reviewers caught. Also replaces the bot's stale LDS facts and adds FlyDSL facts to the refuter prompt.Motivation
From a study of one month of review outcomes on aiter FlyDSL PRs, plus GPU checks on MI355X:
D10 was wrong, and its fix introduced a bug.
flyc.compile()ONLY compiles; it does NOT execute" and asked forcf(*args)on the cache-miss branch.flyc.compile(exe, *args)with live arguments has launched the kernel since it was introduced. Measured on FlyDSL 0.4.0 and 0.4.1 (MI355X), and asserted by FlyDSL's owntest_cached_compile_launches_without_export_work.tensor_shim._run_compiled, which is correct, and following its advice launches twice.D10b asked for
arith.unwrap()around rawarith.bitcast.arithdialect ops are not stable FlyDSL API: onlyfx.arith.__all__is stable, and FlyDSL'sapi-stabilityreports direct uses.fx.Float32(v).bitcast(fx.Int32)lowers to the samellvm.bitcastand is bit-exact (measured on 0.4.0 and 0.4.1).Step 7 stated wrong LDS facts. It said "gfx950 = 64KB" and "gfx1250 (RDNA4)".
chip_infosays gfx950 has 160 KiB, and gfx1250 is not RDNA4 (aiter's FlyDSL code usesfx.rocdl.cdna5for it). A wrong capacity produces false "LDS overflow" findings, a recurring false-positive pattern in agent reviews.Two bug classes human reviewers kept finding had no rule.
Both were frequent in human reviews and missed by agents.
Changes
rules.mdD10 (rewritten, 🔴): fires on a double launch (handle called right afterflyc.compilewith the same live args), on a runtime path that compiles with placeholder/CPU args or underCOMPILE_ONLYand returns without launching, and on a preload path that dispatches._run_compiledon a miss is explicitly clear.rules.mdD10b (rewritten,arith.*op not infx.arith.__all__on a+line. It asks for the typed fx form, or a comment naming the missing API, and no longer asks forunwrap.rules.mdD13 (new, 🔴): a cache ofCompiledFunctions (_run_compiled,FastJitLauncher, module dicts) whose key misses the device, a tensor's rank or unit-stride axis, constexpr/dtype choices or mode globals. Its FP self-check notes that other strides are runtime values: a padded-row view is correct (measured).rules.mdD14 (new,rules.mdHK12: drop the staleop_tests/flydsl_tests/file count.SKILL.mdStep 7: LDS capacity comes fromchip_info.get_lds_capacity_bytes(), and footprints are recomputed with every term (@fx.unionaliases). The line count stays at the 500-line budget.prompts/refuter.md: "FlyDSL facts that kill a finding", a list of the facts behind recurring false positives. It sits outside the verbatim-quoted Step 7.7 block.triage.py: D13 and D14 join theflydslandflydsl-kernelfamilies and the fallback list;selftest.shgains a wrapper-only derivation case.MAPPING.mdis regenerated.Testing
Review-tooling change. See Validation below.
Documentation
The change is itself the reviewer documentation.
Dependencies
Breaking Changes
None. Rule ids D10 and D10b keep their ids with new bodies. D13 and D14 are new.
PR Self-Review
Reviewed revision
0007355
Behavior and intent
Validation and unverified scope
check_prompts.py:OK: 0 drift(s).triage.py expand: emits the D10, D10b, D12, D13 and D14 bodies, with noMISSING-RULE-TEXT.4726326bd48, after review-pr: add HK20 (submodule upstream check) and A4 (new-feature re… #6865 (A4, HK20). Conflicts intriage.pyresolved by keeping both:flydsl-kernelderivesA1 A4 B8 D1 D8 D12 D13 D14 P6 C5andflydslderivesD10 D10b D12 D13 D14 C5, andALL_RULEScarries A4, HK20, D13 and D14.triage.py mapping: output matches the committedMAPPING.md(46 families, 66 rule ids).SKILL.md: still 500 lines.selftest.sh: 95 green / 0 red on Linux (ROCm devcontainer):main's 93 plus two new wrapper-only cases asserting thatflydslderives D13 and D14.COMPILE_ONLYreturnsNoneand does not launch;_run_compiledlaunches once on a miss and once more on a hit.Operand 0 of operation "arith.bitcast" must be a Value, while the typed.bitcastandunwrapforms are bit-exact againstx.view(torch.int32).hipErrorInvalidDevice, printed but not raised, while a fresh compile on device 1 is correct.PR-specific question
The PR Self-Review comment posted no path-specific question for this revision; the readiness report passed all checks other than the draft state.
Changed op tests
None.