build(agc): register each AGC test executable in its own CMake fragment #12862
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/12862"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by janzezno on 2026-10-29T13:03:32Z.
What
Moves the AGC test registrations out of
core/libs/prx/libSceAgcDriver/CMakeLists.txtinto one fragment per test executable,tests/cmake/<executable>.cmake, as agreed in #12521.CMakeLists.txtincludes the fragments in sorted order after the execution tests are created. A new test, a new mode of an existing test or a property of one then changes one fragment instead of shared lines.Three commits:
tools/agc_test_split.pyand its tests.refactorandsplitproduce the next two commits;resolvemoves the registrations of a change made before the split, likedebt_split.py resolve.python3 tools/agc_test_split.py refactor: the three loops that register tests for a list of executables become functions,agc_add_default_test,agc_add_draw_pipeline_testandagc_add_spirv_mode_tests. The execution tests get their default test right after they are created; every other executable calls the function in its own registration. This also removes the longforeach(agcTest IN ITEMS ...)andset(agcDrawPipelineTests ...)lines that pull requests append to.python3 tools/agc_test_split.py split: 279 fragments;CMakeLists.txtgoes from 4506 to 909 lines. A statement moves with the executable whose targets or tests it changes; statements that write the same variable move together; a loop over several executables and anything that reads every registered test stays inCMakeLists.txt. A test name built from a variable (set_tests_properties(agc_pad_status_overlay_${padStatusName} ...)) moves with the one executable whose tests share its literal prefix; when the prefix matches tests of several executables,splitstops with an error instead of leaving the statement before the fragments. Fragments that share a statement are merged into the fragment of the larger executable: 3 fragments hold 8 executables, from statements like oneset_target_propertiesover four overlay executables. Comment lines are not carried into fragments; one two-line comment, beforeagc_driver_vertex_clip_cull_draw_no_key, is dropped. The commit also adds theresolverule to CONTRIBUTING.md.The fragment commit is generated, so it can be regenerated from the
mainit lands on:git checkout main -- core/libs/prx/libSceAgcDriver/CMakeLists.txt, deletetests/cmake, runrefactorandsplitagain.After the split, a pull request whose
CMakeLists.txtchange conflicts runspython3 tools/agc_test_split.py resolveduring the stopped rebase; the rule is in CONTRIBUTING.md, after "Keep the branch up to date".Regenerated on
mainca073ec3ad. Since73f4f7e06ethe file only gained #9696'sagc_driver_target_address_windowblock, which is now its own fragment. Theresolveresults under Tested are from73f4f7e06e, where 191 other open pull requests changed the file.Merge order with #11566 (agreed with B-Howell): #11566 is still open, so this goes first and #11566 moves its registration with
resolve, which gives exactly the split of the merge (below).Merge order with #14084 (agreed with Amoenus): this goes first and #14084 moves its
agc_driver_native_depth_initial_ownerregistration withresolve. Checked onca073ec3adwith #14084 atb582949003:resolveputs it inagc_driver_native_multisample_depth_tests.cmakewith no conflict, and every file is identical to the split of the merge.Tested
Arch Linux, CMake 4.4.5, Ninja 1.13.2, GCC 16.2.1.
Registration: configured
main0f302813ceand this branch regenerated on it with the same options (the branch's diff is byte-identical onca073ec3ad, which only adds #13671 inlibSceNpWebApi) and compared every test's command and properties (ctest --show-only=json-v1, source and build directory paths normalized) and the targets inbuild.ninja(ninja -t targets all). In each configuration below the only differences are the newagc_test_splittest and the 279 fragment filesbuild.ninjalists as configure inputs. In the first configuration the build commands (ninja -t commands all, 6634) are identical too.mainBUILD_TESTING=ONBUILD_TESTING=ON,ANYPS5_ENABLE_SPIRV_TOOLS=ONBUILD_TESTING=ON,AGC_BUILD_VISUAL_TEST=ONBUILD_TESTING=ON,ANYPS5_ENABLE_ASAN=ONBUILD_TESTING=ON,APS5_ENABLE_TRACY=ONBUILD_TESTING=ON,ANYPS5_AGC_EXECUTION_TESTS=PooledBufferRangeBUILD_TESTING=ON,ANYPS5_AGC_EXECUTION_TESTS=PooledBufferRange;CommittedReadMappingBUILD_TESTING=ON,ANYPS5_RELINKER_CLI=OFFBUILD_TESTING=ON,ANYPS5_RUN_QUARANTINED_FRAME_REPLAY=ONBUILD_TESTING=ON,CMAKE_CXX_COMPILER_LAUNCHER=ccacheBUILD_TESTING=OFFset(WIN32 ON)at the top of the AGCCMakeLists.txtset(WIN32 ON)andset(MINGW ON), with a stand-inanyps5_windows_test_exitThe
WIN32/MINGWrows only run the Windows branches of this directory on Linux. A Windows (MSYS2) comparison is still open; I can't run one, so a run on Windows (ctest -Nandctest --show-only=json-v1onmainand this branch) would close it.Rebase script,
resolve:main73f4f7e06ethat changed the file: applying each one's change to the split of its parent gives exactly the split of the commit, with no conflicts, 150 of 150.main73f4f7e06e, before this regeneration: all 153 that merge cleanly today give exactly the split of that merge, #11566 among them; 5 that conflict today apply without a conflict; 17 conflict both ways, 16 of them in one fragment each (10 in the recorder tests, 4 in the native multisample depth tests, 1 each in the shader memory and graphics tests) and #5925 inCMakeLists.txtand three fragments; 16 leave the file unchanged.python3 -m unittest tools/tests/test_agc_test_split.py: 15 tests pass.python3 tools/check_test_registration.pyon the configured branch: 1632 test executables, none built and not run, as onmain;--scripts: 231 test scripts, each run (230 onmain, plustest_agc_test_split.py).Not built or run beyond configuration: no source file changes, and the registrations are identical.
Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)main)Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-31T17:24:27Z.
Review: CHANGES_REQUESTED
main:core/libs/prx/libSceAgcDriver/CMakeLists.txtchanged 5 times after73f4f7e06e. The last two commits are generated, so please regenerate them from currentmain(git checkout main -- core/libs/prx/libSceAgcDriver/CMakeLists.txt, deletetests/cmake,refactor,split) and re-run thectest --show-only=json-v1comparison on the new base.python3 tools/agc_test_split.py resolveduring a stopped rebase, but the PR does not touchCONTRIBUTING.md(thedebt_split.py resolverule at line 78 is the model). Add it there, otherwise authors of the other open PRs have no way to learn it.The tooling itself looks fine; with these addressed it can go to the merge queue.