Skip to content

agx/tests: drop duplicate cases and setup boilerplate in compiler tests - #1456

Merged
DjDeveloperr merged 1 commit into
aurora-wipfrom
hygiene/trim-compiler-tests
Dec 1, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-wipfrom
hygiene/trim-compiler-tests

Conversation

@RyanTheTide

Copy link
Copy Markdown

What: Make three compiler unit tests shorter (audit-merged-20261201 section 2, rows 13, 19, 22). Tests only, and every test that covers a fix stays. 165 lines removed, 62 added (one helper in each of two files).

  • test-sampled-compute-register-cap.cpp (agx: derive a register cap for sampled compute from occupancy #461):
    • Drop NoCapOnAGX2WithoutStaticTPS and the AGX2 row of NoCapWithoutOptionalSpills. agx_ra() takes its cap from agx_sampled_compute_register_cap(), and DerivedFromFileAndOccupancy already checks that it is 0 on AGX2.
    • Move the G17C compile key of the three end-to-end tests into one compile_g17c_sampled() helper.
  • test-agx3-fm-wave2.cpp (agx: rotate AGX3B integer-ALU compute loops and interleave IC/SCIB pipes #1302):
    • Build the test shaders through one fm_test_builder() helper instead of 9 copies of the same 10 lines.
    • Drop G16G from the targeted granule repro loop. The sweep below it runs the same shapes on G16G (any_cf, preload at half 2, BFEIL, 24 alt halves). G15S and G17P stay because RA has chip-gated bank rules.
  • test-agx3-pack-binary.cpp (agx: trim unused trailing vector memory load channels after address lowering #877): TrimmedF16Vec3MemoryLoadsPack walked the NIR for the trimmed load as well as the binary. The binary check (exactly one W16 load with mask 0x7, none with 0xf) already proves the trim, and test-shrink-memory-loads covers the NIR pass.

Tested: No runtime change (tests only). x86 container aurora/hk6356-mesa-x86-tests:local, release + asserts, -Dgallium-drivers=asahi -Dvulkan-drivers=asahi -Dbuild-tests=true:

  • Base aurora-wip c80e027, agx_tests --gtest_filter='SampledComputeRegisterCap.*:FmWave2*.*:AGX3PackBinary.TrimmedF16Vec3MemoryLoadsPack:ShrinkMemoryLoadsTest.*': 37/37 PASSED.
  • This branch, same filter: 36/36 PASSED (one AGX2 case removed). The three touched TUs add no new warnings.
  • meson test --no-rebuild agx_tests hk_sync_prior asahi-zero-lod-bias-nir: Ok 3, Fail 0.

Risk: two-way · none (no runtime change).

Not yet:

Tests only; no compiler change. Every test that covers a fix stays.

test-sampled-compute-register-cap (mesa#461): drop the AGX2 RA case and
the AGX2 row of NoCapWithoutOptionalSpills. agx_ra() takes its cap from
agx_sampled_compute_register_cap(), and DerivedFromFileAndOccupancy
already checks that it is 0 on AGX2. Share the G17C compile setup of the
three end-to-end tests in one helper.

test-agx3-fm-wave2 (mesa#1302): build the test shaders through one
fm_test_builder() helper instead of nine copies of the same 10 lines.
Drop G16G from the targeted granule repros: the sweep below runs the
same shapes (any_cf, preload at half 2, BFEIL, 24 alt halves) on G16G.

test-agx3-pack-binary (mesa#877): TrimmedF16Vec3MemoryLoadsPack walked
the NIR for the trimmed load as well as the binary. The binary check
(one W16 load with mask 0x7, none with 0xf) already proves the trim,
and test-shrink-memory-loads covers the NIR pass itself.

Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
@RyanTheTide
RyanTheTide requested review from a team and DjDeveloperr as code owners December 1, 2026 04:53

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Verdict: MERGE at 05bc4d63e8be

Checked: Refactor: fm_test_builder() reproduces the removed builder setup exactly; every caller starts from a fresh key = {}, the per-stage loop passes has_scratch=false as before, compile_g17c_sampled() uses ASSERT_* inside a void helper with ASSERT_NO_FATAL_FAILURE at call sites (correct gtest pattern). Dropped cases: AGX2 no-cap case and one duplicate G16G leg, and the NIR trim check now covered by test-shrink-memory-loads per the header note.

Follow-ups (not blocking): none

@github-actions github-actions Bot added area:compiler Area from CODEOWNERS (bot) blast:none Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Merge readiness at 05bc4d63: not ready yet

Check Detail
CI at head no failing: selftest
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok not needed: no runtime change
Conflicts ok not computed yet
PR text ok Risk: two-way · none (no runtime change).

Areas: area:compiler

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@github-actions github-actions Bot added the ci-failing A check failed at the PR head (bot) label Dec 1, 2026

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed the three compiler test changes. The cap derivation still asserts a zero cap on AGX2, the G16G sweep retains the tested register-pressure shapes, and the W16 packed-load check remains alongside the dedicated NIR trim tests. Both build-test jobs passed.

@DjDeveloperr
DjDeveloperr merged commit 5448f49 into aurora-wip Dec 1, 2026
15 of 16 checks passed
@DjDeveloperr
DjDeveloperr deleted the hygiene/trim-compiler-tests branch December 1, 2026 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:compiler Area from CODEOWNERS (bot) blast:none Macs affected, from Merge risk (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants