Skip to content

build(agc): share a precompiled header across the execution tests - #10164

Open
LeandroLP23 wants to merge 1 commit into
boykopovar:mainfrom
LeandroLP23:build/agc-execution-tests-pch
Open

LeandroLP23 wants to merge 1 commit into
boykopovar:mainfrom
LeandroLP23:build/agc-execution-tests-pch

Conversation

@LeandroLP23

Copy link
Copy Markdown
Contributor

What

#10163: each AGC execution test object spends most of its compile time parsing the same headers. 463 of the 478 tests/execution sources include VulkanTestDevice.hpp, which pulls in VulkanDevice.hpp, Draw.hpp, Recompiler.hpp and about 35 more project headers.

The loop that defines the execution tests now gives them one shared precompiled header. The first test builds it from tests/execution/VulkanTestDevice.hpp, <array>, <iostream>, <span>, <string> and <vector>. The other tests reuse it through target_precompile_headers(... REUSE_FROM ...). They are all defined in this loop with the same include directories, flags and CXX_EXTENSIONS OFF, so one PCH fits every one. No source file changes. CMake compiles with -Winvalid-pch, so a PCH that does not match a target is reported rather than silently skipped.

When CMAKE_CXX_COMPILER_LAUNCHER is ccache, these targets run it through cmake -E env CCACHE_SLOPPINESS=pch_defines,time_macros. Without that setting ccache refuses every object built with a PCH ("Could not use precompiled header": 2 of 2 calls uncacheable here). That would make the CI and local caches miss on all 478 objects. cmake -E env works with any ccache version. The ccache key=value command-line form needs 4.8 or later.

Tested

Ryzen AI 7 350, Radeon 860M (AMD driver 32.0.13058.8001), Windows 11 26300, WinLibs GCC 15.2.0, Release, BUILD_TESTING=ON. Built on main d339082d2e, same build directory for both sides. The branch is the same change on main c928aeb0a2: the libSceAgcDriver/CMakeLists.txt commits in between add tests to lists and do not touch the execution test loop.

Rebuild after a header edit. Touch tests/execution/VulkanTestDevice.hpp, then build every tests/execution object with ccache disabled, at -j 4, below-normal priority:

Compiles Time
main 463 664 s
this PR 479 (the PCH, then all 478 objects) 341 s

That is 49% less time for the same objects. All 478 now depend on the PCH, so the 15 sources that did not include VulkanTestDevice.hpp also recompile when it changes. They are counted above.

Why the PCH helps: five sources taken at even intervals from the target list, each compiled alone on an idle machine, parse in 2.1 to 4.6 s with -fsyntax-only and compile in 2.4 to 4.1 s at -O3. Parsing is most of each compile, and -O1 is no faster.

ccache. After a populated build, I deleted 40 execution test objects and rebuilt them: 40 of 40 were direct ccache hits, in 4.9 s.

Tests. cmake --build build builds cleanly. One PCH is built (199 MB). Recompiling two objects with ninja -v prints no PCH warning. With ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, ctest -R '^agc_' -j 4 passes 939 of 942. The 3 failures are agc_driver_sample_order, agc_driver_sample_order_grid_reference and agc_driver_sample_order_recipe_depth_locations, the AMD Windows failure of #9507. They fail the same way without this change. The 3 skipped tests (agc_host_import_sparse, agc_driver_ngg_vertex_wave_reduction, agc_driver_sparse_dma_buf_import) also skip on main on this machine. The validation layer is not installed here. The change only affects how these objects compile, not what they record.

Not run here: Linux and macOS. GCC and Clang both support target_precompile_headers with REUSE_FROM, and CI builds both.

tools/check_conventions.py --base origin/main passes. tools/pr_overlap.py --branch reports no conflicting lines. 60 open PRs that conflict with main share this CMakeLists.txt. Seven of them edit near the execution test loop: #6169, #6788, #7642, #8014, #8874, #9508 and #9892. Their changes there are to the foreach(agcTest IN ITEMS ...) list below it, not to the lines this PR adds.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: Build: each of the 478 AGC execution test objects parses the same header set again #10163
  • Unblocks: none (build time only)
  • GPUs tested: AMD Radeon 860M, driver 32.0.13058.8001, Windows 11 (the AGC tests, run to check the build change)
  • AI-assisted: yes (Claude Code)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed head 3fe7aaf against the current main. The change is scoped to the execution-test target loop, and the PR reports measured rebuild, ccache-hit, full build, and AGC test results with the three known AMD failures and three skips clearly called out. I also confirmed the PR checks: conventions, eligibility, intake, labels, and report pass; full Linux/Windows build jobs are skipped by the repository PR policy. No blocking issue found in the patch. AI assistance is disclosed in the checklist.

@github-actions

github-actions Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1368 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1395 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 1896 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 2434 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5021 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5371 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 5925 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6187 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6188 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6192 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6209 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6280 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6300 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6412 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6481 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6808 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 6959 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7048 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7201 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7275 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7457 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7514 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7604 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7642 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 7677 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8014 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8246 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8484 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8592 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 8874 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9020 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9248 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9335 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9508 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9533 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9700 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9717 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9742 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9748 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9892 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9897 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9898 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9940 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 9989 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10000 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10026 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10159 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10193 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10442 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10443 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10489 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10492 core/libs/prx/libSceAgcDriver/CMakeLists.txt
PR 10497 core/libs/prx/libSceAgcDriver/CMakeLists.txt

@github-actions github-actions Bot added the fix error Closes an issue (Fixes #N) label Oct 23, 2026
@oneandonlydean oneandonlydean self-assigned this Oct 23, 2026

This branch has not been deployed

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

Labels

agc libSceAgc* build fix error Closes an issue (Fixes #N)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build: each of the 478 AGC execution test objects parses the same header set again

3 participants