Skip to content

test(jit): check EpCfg's field count against VisitFields, not a literal - #727

Merged
QizhouZhang97 merged 1 commit into
ROCm:mainfrom
jhchouuu:jiahzhou/fix-jit-fieldcount
Oct 9, 2026
Merged

QizhouZhang97 merged 1 commit into
ROCm:mainfrom
jhchouuu:jiahzhou/fix-jit-fieldcount

Conversation

@jhchouuu

@jhchouuu jhchouuu commented Oct 8, 2026

Copy link
Copy Markdown
Collaborator

Problem

CCO CI on main fails in "Run JIT v2 C++ tests":

test_jit_core.cpp:78: Failure
  FieldCount<EpCfg>()  Which is: 15
  12u                  Which is: 12

The test hard-coded 12. #719 added combineFp4 and combineFp4F32Scale, and #723 added selfFirst. Each updated only the header's own MORI_JIT_ASSERT_FIELD_COUNT(EpCfg, ...) and never this literal. Every field was added to VisitFields, so main has no functional bug.

Because of this failure, none of the ops-v2 EP8 steps after it have run on main since 8bffec7:

  • HIP backend
  • per-token scales
  • the fp8/fp4 quantizing wire
  • FlyDSL vs HIP parity
  • the bench smoke

Change

FieldCount.MatchesEpCfg now counts the VisitFields(EpCfg) walk and compares that with FieldCount<EpCfg>(). That is the invariant the test's comment describes: a field missing from VisitFields never reaches the rendered text, which is the JIT cache key, so two configs that differ only in that field would silently share a kernel.

The header assert cannot catch that case, because it counts struct members. The old literal duplicated the header's number without checking anything.

Testing

Run on MI355X (ROCm 7.14) with an image built from docker/Dockerfile.dev, and mori built with the ci_cco.yml flags:

  • Before this change. ctest -R '^jit_' on origin/main (066fd10) reproduces the CI failure.
  • After. jit_core and jit_host_device_split both pass.
  • Negative check. With MORI_FIELD(selfFirst) removed from VisitFields, the build still succeeds and the header assert stays silent. This test then fails with 15 vs 14, and passes again once the header is restored.
  • The CI steps this failure was hiding, run by hand on origin/main, all pass:
    • JIT Python binding: 19 passed, 4 skipped (selfFirst is gfx125x-only)
    • test_dispatch_combine_v2_intranode: 18 passed
    • HIP test_op, with and without per-token scales
    • test_asym_dtype with fp8 and fp4 dispatch at SCALE_DIM=224
    • backend parity, and bench_ep at 8/8 points

🤖 Generated with Claude Code

FieldCount.MatchesEpCfg pinned 12. ROCm#719 grew EpCfg to 14 (combineFp4,
combineFp4F32Scale) and ROCm#723 to 15 (selfFirst), and both updated only
the header's own assert. CCO CI stops at this test on every run since
ROCm#723 (ROCm#719's run had already stopped at an earlier step), so the ops-v2
EP8 steps have not run on main since 8bffec7.

Count the VisitFields walk instead. That is the invariant the test is
there for, and unlike the header's MORI_JIT_ASSERT_FIELD_COUNT it also
catches a field left out of VisitFields.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@jhchouuu
jhchouuu requested a review from QizhouZhang97 October 8, 2026 11:06
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