Repository navigation
agx/tests: drop duplicate cases and setup boilerplate in compiler tests - #1456
Conversation
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>
There was a problem hiding this comment.
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
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
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.
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):NoCapOnAGX2WithoutStaticTPSand the AGX2 row ofNoCapWithoutOptionalSpills.agx_ra()takes its cap fromagx_sampled_compute_register_cap(), andDerivedFromFileAndOccupancyalready checks that it is 0 on AGX2.compile_g17c_sampled()helper.test-agx3-fm-wave2.cpp(agx: rotate AGX3B integer-ALU compute loops and interleave IC/SCIB pipes #1302):fm_test_builder()helper instead of 9 copies of the same 10 lines.test-agx3-pack-binary.cpp(agx: trim unused trailing vector memory load channels after address lowering #877):TrimmedF16Vec3MemoryLoadsPackwalked 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, andtest-shrink-memory-loadscovers 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:agx_tests --gtest_filter='SampledComputeRegisterCap.*:FmWave2*.*:AGX3PackBinary.TrimmedF16Vec3MemoryLoadsPack:ShrinkMemoryLoadsTest.*': 37/37 PASSED.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:
test-shrink-memory-loads.cpp(agx: trim unused trailing vector memory load channels after address lowering #877) is unchanged. Each of its 10 cases checks a different rule ofagx_nir_shrink_memory_loads(): trailing and leading trims, vec/pack/non-ALU uses, divergent vec3, CSE siblings, packed words.nkeeplist and the four mixed-op kinds stay. Each value targets a different granule or a different op class in the pure-int filter.