Skip to content

test(agc): bound cold store kernels without reducing coverage - #1999

Closed
kali113 wants to merge 6 commits into
boykopovar:mainfrom
kali113:fix/agc-test-runtime
Closed

kali113 wants to merge 6 commits into
boykopovar:mainfrom
kali113:fix/agc-test-runtime

Conversation

@kali113

@kali113 kali113 commented Oct 9, 2026 •

Copy link
Copy Markdown
Contributor

What

The FLAT-store and VCC-base execution tests still approach or exceed CONTRIBUTING.md's 30-second limit when Mesa shader caching is disabled and four tests contend for the CI runner's cores. Splitting only by wave size was insufficient: individual monolithic shaders still timed out.

Register bounded instruction groups:

  • FLAT stores: scalar address forms, load-after-store with EXEC masking, byte/halfword, unaligned dword, and each vector width. Each group runs wave32, wave64 and read-only cases: 21 registered tests.
  • VCC global bases: dword load, vector load and returning atomic, each in wave32, wave64 and split-wave64 modes. Keep all three existing ADDTID modes: 12 registered tests.

Build each kernel from unchanged instruction words in the original arrays. Keep the original 64-thread workgroup, input values, output locations, memory comparisons, rejection checks and capability gates. The feedback group includes the store that feeds its subsequent load. Every group also checks untouched memory, and each FLAT group retains its read-only assertion. Keep the existing serial scheduling of the primary FLAT test; the validation run also disables that property to test it under contention. Set each registered case's timeout to 30 seconds.

No production shader semantics, guest-memory policy or timeout increase is included in this PR's own change. Default executable invocations still exercise all scenarios.

Depends on: #1265, #1913

The branch carries popcoder565's three existing BDA code-size commits from #1265 and gunerky's bounded TLS groups from #1913 with original authorship. The own test change is 5110b507. Merge prerequisites first. Duplicate check: the 526-open-PR audit found the production optimization in #1265 and the existing TLS grouping in #1913; neither divides these store shader kernels into bounded instruction groups.

The overlap bot's #1971 comment refers to the earlier registration layout. The existing primary serial-property line is retained, and a local merge of this head with latest #1971 (e3180e13) is clean. #1971 is not required for these tests.

Tested

Current head 9a3ddebe incorporates upstream main a8b032b2 (#2083) without conflicts. All latest checks pass (full upstream CI). Linux: 558 registered cases, zero failures, longest 22.10 s. Windows: 549 registered cases, zero failures, longest 14.35 s. No test exceeds 30 seconds. Windows Vulkan cases skip when no usable device is available; Linux executes them on lavapipe.

Before reopening this PR, native Linux/Windows validation on validation head 8aa8cffc, which differs from source head 5110b507 only by its validation workflow:

  • Linux Release / GCC / lavapipe, project CI configuration with SPIR-V Tools enabled: all 33 registered cases pass under an enforced 30-second limit, four concurrent tests, and MESA_SHADER_CACHE_DISABLE=true. Each executable case passed three times (90 executions); three ADDTID modes skip on lavapipe's eight-lane subgroups. Longest cold case: 15.06 seconds. The validation disables the primary case's existing serial property too, so this includes contention for every executed case.

  • Windows Release / WinLibs GCC 15.2: both executables build; all 33 registered modes skip correctly without a usable Vulkan device (longest 0.18 seconds). No Windows GPU execution is claimed.

  • Conventions, registration check and git diff --check pass. No physical-GPU, console or title testing is claimed for this test-only change.

Checklist

@kali113 kali113 changed the title test(agc): run expensive store scenarios independently test(agc): validate BDA store optimization against CI runtime limits Oct 9, 2026
@MarcZX10

MarcZX10 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

I reviewed the three-file diff and exact-head CI. Build and Conventions pass, and Windows CTest passes. Linux CTest fails six cases at the 30-second limit: the existing agc_driver_flat_store (30.08 s) and agc_driver_global_vcc_base (30.05 s), plus new flat_store_wave64 (30.07 s), flat_store_read-only (30.07 s), global_vcc_base_base-wave64 (30.05 s), and global_vcc_base_base-split (30.05 s). The three addtid cases skipped on lavapipe capability. These timeouts mean the scenario assertions did not complete, and the split does not meet CONTRIBUTING.md’s per-test 30-second limit on the cold Linux runner. Please reduce the cold work in each case while keeping the first-run/no-cache coverage requirement; increasing the timeout would conflict with the project rule. The draft status is appropriate until Linux passes.

@github-actions github-actions Bot added build shader core/shader agc libSceAgc* labels Oct 9, 2026
@kali113 kali113 closed this Oct 9, 2026
@MarcZX10

MarcZX10 commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

I checked the current head and run 37885025886: Linux and Windows Build/CTest now pass, including the 30-second reporting step. The only current failure I found is Conventions on commit 117788aa (Revert "test(agc): run expensive store scenarios independently"), as the log confirms. Since you say this scratch-revert history will not be carried into #1829, the draft can remain a validation reference; if you want this PR itself reviewable, the commit subject/history needs a Conventional Commits cleanup before the checks will be green.

popcoder565 and others added 5 commits October 9, 2026 07:07
Every 8- and 16-bit BDA store and the unaligned path of every 32-bit store emitted one get_bda_write_pointer lookup and one note_bda_write per byte at the store site, five write lookups per 32-bit store. They now call write_bda_bytes, which loops over the bytes and does, per byte and in order, the same lookup, the store when it is mapped and the write note, so faults are recorded exactly as before. On an RTX 3060 the agc_driver_flat_store binaries shrink from 496,256 to 138,240 bytes (wave32) and from 928,384 to 225,152 bytes (wave64), and the cold run from 19.7 s to 2.2 s.
note_bda_write unrolled its 8 compare-exchange probes, and drivers inline it at every BDA store and atomic. The probes now run in a loop that tries the same slots in the same order and stops at the same slot, so the recorded pages and the overflow flag are unchanged. With the byte store helper, the agc_driver_flat_store binaries on an RTX 3060 go from 138,240 to 75,648 bytes (wave32) and from 225,152 to 130,560 bytes (wave64), and the cold run from 2.2 s to 1.2 s.
… path

The declaration, the state field and the definition of write_bda_bytes now sit next to EmitBdaStore and the other BDA write functions instead of next to the dword read functions, which boykopovar#1267 extends at the same lines. No change to the emitted code.
@kali113 kali113 changed the title test(agc): validate BDA store optimization against CI runtime limits test(agc): bound cold store kernels without reducing coverage Oct 9, 2026
@kali113 kali113 reopened this Oct 9, 2026
@kali113
kali113 force-pushed the fix/agc-test-runtime branch from 9087d4e to 5110b50 Compare October 9, 2026 06:37
@kali113
kali113 marked this pull request as ready for review October 9, 2026 06:52
Copilot AI balanced review requested due to automatic review settings October 9, 2026 06:52

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: #1265 takes agc_driver_flat_store from 19.7 s to 1.2 s and agc_driver_global_vcc_base from 6.9 s to 1.5 s on a cold run, which removes the timeout this splits around. If one of them still passes 30 s after #1265 is in, please reopen with only the test change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* build relinker shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants