Repository navigation
Conversation
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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.
|
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed the per-key build coordination in both CachedPipeline and LinkPipelineFromLibraries. The key-specific mutex/set is acquired outside the global cache mutex; after waiting, each path rechecks the resident cache, and RAII clears its in-flight marker on Vulkan failures or exceptions. The library store tracks active builds so clear waits for them. The added synthetic tests cover shared keys, distinct keys, cache hits, failure/exception cleanup and clear-time waiting; the PR reports 32/32 focused Windows tests with validation enabled, and its Windows CI plus conventions/intake/labels/report checks pass. Linux product jobs were skipped by path policy; I did not run the GPU suite locally.
❌ NVIDIA GPU test: failedPR head
New validation errorsThis PR changes test files, so each test below was also run on main with only the PR's test changes applied; 0 there means the PR's other changes cause the error.
agc_driver_depth_clear_hle: new validation messagesUnstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Passed on retry (1, failed in the parallel run, passed when re-run with a 360 s timeout; not counted against this PR)Validated but not compared (10, not in the main baseline's validation pass)Validation IDs already present on main (4 IDs in 439 tests)Skipped (39)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
This branch predates build.lock = std::unique_lock(*build.mutex);
{
std::lock_guard lock(store.mutex);
bool collision = false;
if (auto pipeline = lookup(collision)) {
++store.hits;
++store.totals.hits;
return pipeline;
}The first hit path and the raced-insert path both set it. Fix: |
# Conflicts: # core/libs/prx/libSceAgcDriver/CMakeLists.txt
|
For #11914 (head |
✅ NVIDIA GPU test: passedPR head
Unstable on main (3, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validated but not compared (10, not in the main baseline's validation pass)Validation IDs already present on main (5 IDs in 484 tests)Skipped (45)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
XairRrR
left a comment
There was a problem hiding this comment.
Reviewed — approved
The per-key serialization of identical graphics-pipeline and library-part builds is correct. The new fixtures pass on the merged tree and fail with main's production files. The two automated flags (agc_map_gate_disjoint, one VUID) also reproduce with main's production files.
What I ran
Head 951b79acc77505d59e4c1c976312b3fff58e5bf7, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree 1acd9902125e6099293588bd55055d974c5960f6 (Debian 13 VM, GCC 14.2.0, Release, lavapipe / Mesa 26.1.6, LLVM 19).
git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...951b79acc77505d59e4c1c976312b3fff58e5bf7
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
ctest --test-dir build -j8 --test-load 32 -R "^agc_pipeline_(store|library)_builds_|^agc_map_gate_disjoint$" --output-on-failure
ctest --test-dir build -R "^agc_map_gate_disjoint$" --repeat until-fail:20 --output-on-failure
ctest --test-dir build -j8 --test-load 32 -R "^agc_pipeline_(store|library)_builds_" --repeat until-fail:20
# negative control: Pipeline.cpp and PipelineLibrary.cpp restored from main
ninja -C build -j32 -l32 agc_driver_recorder_tests agc_pipeline_store_builds_tests agc_pipeline_library_builds_tests agc_driver_native_multisample_depth_tests
ctest --test-dir build -j8 --test-load 32 -R "^agc_pipeline_(store|library)_builds_" --output-on-failure
ctest --test-dir build -R "^agc_map_gate_disjoint$" --repeat until-fail:30
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer ctest --test-dir build -V -R "^agc_driver_native_depth_uniform_planes$" # merged and main production files
Results
| Check | Result |
|---|---|
git diff --check |
clean |
check_conventions.py |
All conventions checks passed |
Configure / build / libs (script) |
passed |
New tests agc_pipeline_store_builds_* (5), agc_pipeline_library_builds_* (5) |
10/10 pass; 20 repeats each under -j8 pass; each run ≤ 0.35 s |
agc_map_gate_disjoint (script's only new failure) |
flaky: failed on the 2nd of 20 repeats on the merged tree, and on the 8th of 30 repeats with main's Pipeline.cpp/PipelineLibrary.cpp. It comes from main, not this PR |
Validation: agc_driver_native_depth_uniform_planes new VUID-vkCmdDispatch-groupCountX-00386 (script, "test not run on main") |
8 occurrences on the merged tree and the same 8 with main's production files; the layer loaded in both runs. It comes from main, not this PR |
| Other selected tests (script) | 2117 passed; the 7 known failures also fail on main; 114 expected skips |
agc_map_gate_disjoint failure (same output on the merged tree and with main's production files)
[libc] unhandled exception 'St13runtime_error' thrown from 0x564020783afe
Vulkan device: llvmpipe (LLVM 19.1.7, 256 bits)
host imports are compared
AGC graphics: (d) no watched block on other stripes
Negative control
I restored core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp and PipelineLibrary.cpp from main, kept the PR's tests and rebuilt. 7 of the 10 new tests failed:
Output
agc_pipeline_store_builds_shared / failure / exception: FAIL: lookup did not wait only for its own in-flight pipeline
agc_pipeline_library_builds_shared / failure / exception: FAIL: the same library part was compiled concurrently more than once
agc_pipeline_library_builds_clear: FAIL: clearing allowed duplicate part builds
30% tests passed, 7 tests failed out of 10
The 3 modes that still pass (store_builds_cached, store_builds_independent, library_builds_independent) check that unrelated work is not blocked, so they should pass on main too. I then restored the merged files and rebuilt; git status --porcelain is empty.
Findings
Blocking
None.
Non-blocking
- The per-key build mutex is held across the journal append.
build(see Pipeline.cpp#L1309-L1319) is destroyed only at function return. So threads waiting on the same key also wait forRecordGraphicsPipelineat Pipeline.cpp#L1382, even though the entry is already resident after the store insert. Rendering is still correct; this only adds latency for the waiter. Releasingbuild.lockonce the insert block has finished would let waiters hit straight away. - The description is garbled. In the "Review follow-up" section, a copy of the checklist is pasted inside the
textcode block, which splits the--repeat until-fail:10command line. The real checklist further down is complete (Depends on, Fixes, Unblocks, GPUs tested and AI-assisted are all filled in). Cosmetic only.
Code reading, for the record:
- Lock order is always per-key mutex, then
store.mutex. Waiters releasestore.mutexbefore taking the per-key mutex, and~PipelineBuildtakesstore.mutexwhile the per-key lock is still held. There is no inversion. use_count() == 1is evaluated understore.mutex, the same mutex under which waiters get theirshared_ptr. An expiredweak_ptris replaced throughinsert_or_assign.- In
LinkPipelineFromLibraries, a thread holds a part marker only while it builds that part, and drops it before the next part. A waiting thread holds no marker, so cross-part waits cannot deadlock.PartBuildre-locks before erasing on both theCheckthrow and the exception path. - The waited-hit
storeHashfix reported by chitters2004 and oneandonlydean is in Pipeline.cpp#L1320-L1328, andstore_builds_sharedchecks it. I confirm that their finding is resolved.
Not verified
- I had no hardware GPU, only lavapipe. The NVIDIA RTX 3080 results in the description and the NVIDIA CI comments are the author's and TechLevelZero's; I did not reproduce them. The new fixtures use stub Vulkan entry points, so they do not depend on the driver.
- I did not run the full suite or any title. I did not measure throughput when several draw threads miss on the same key.
- The
VUID-vkCmdCopyBuffer-commonparentreported onagc_driver_depth_clear_hlein the first NVIDIA CI run, at the older headda3ca94, did not reappear in the later run atd64f238. I did not investigate it on lavapipe.
✅ AMD GPU test: passedPR head
Unstable on main (2, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (8, not counted against this PR)Validated but not compared (10, not in the main baseline's validation pass)Validation IDs already present on main (4 IDs in 516 tests)Skipped (58)ReproduceAutomated build and test on a contributor's AMD machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
✅ NVIDIA GPU test: passedPR head
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (3, not counted against this PR)Validated but not compared (10, not in the main baseline's validation pass)Validation IDs already present on main (4 IDs in 517 tests)Skipped (48)ReproduceAutomated build and test on a contributor's NVIDIA machine; it does not replace upstream CI. A new comment is posted for each new push. Full logs. |
|
@Bram910 the build of this PR on current main fails at Either make |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — no blocking findings
Nothing blocks this change; the review points below are optional.
What I ran
Reviewed head 951b79acc77505d59e4c1c976312b3fff58e5bf7 using repo_read.py reader tools. I inspected the prepared description, commits, manifest and diff, and read all six changed repository files. No executable checks were run; test results in the PR description are author-reported.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | All six changed files read |
| Tests in this review | not run | No execution environment available |
| Author-reported tests | not run | Not independently verified |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The PR's reported test runs, build, conventions check, and diff check were not independently verified. review/files.json was not available through the reader; the manifest and file listing show six changed files, all included and read. No changed files were excluded in the manifest.
To get this to a good state
Nothing is required.
ligmaSec
left a comment
There was a problem hiding this comment.
The trial merge is clean. The new store and library fixtures cover same-key sharing, independence across keys, and retry after both a Vulkan failure and a C++ exception. Please retain the clear-versus-build fixture as well as the resident lookup control. Together they check that waiters are woken on failure and that clearing cannot destroy a part still being published. I have no paired Vulkan result for this head yet.
AI-assisted: yes.
What
Concurrent misses for an identical graphics-pipeline key can currently compile the same pipeline or library part multiple times before discarding the raced result. Serialize builds for the same full key, recheck the resident entry after waiting, and release the build marker on Vulkan failures and C++ exceptions. Different keys and resident hits can continue independently. Retain the current LTO key and cache admission policies. A cache hit after waiting also returns its store hash, so the caller can memoize the pipeline for that draw shape.
Tested
Windows 11 Pro 10.0.26200, MinGW GCC 15.2, Release, same NVIDIA GeForce RTX 3080 and driver 610.47 (Windows 32.0.16.1047).
Built
libSceAgcDriver, recorder/graphics/disk-cache/queue-failure test targets and this PR's added fixture target(s). Focused baseline atca0e9557aab1d1496c2c317077dd258f2d16fbf8: 100% tests passed, 0 tests failed out of 22. This branch atda3ca94b1e64663ecbc799f7ddbeba072fbfaafd: 100% tests passed, 0 tests failed out of 32.Both runs used
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_GPU=NVIDIA,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, andVK_LAYER_PATH=C:\VulkanSDK\1.4.363.0\Bin:Neither verbose log reports a missing validation layer, skipped/unrun selected tests, or
VUID-errors. Ten deterministic concurrency/failure/teardown fixture modes, repeated 20 times each (200 executions). Existing real-Vulkan library reuse, LTO, cache, teardown, store and journal tests also run.python tools/check_conventions.py --base origin/mainandgit diff --check origin/main...HEADpass. The project'spr_overlap.pycomparison logic was run against open PRs using a public REST transport adapter because local gh is unauthenticated. Its report warns about older PRs that conflict with main; their shared-file diffs were inspected separately. No equivalent fix was found. Related overlapping files may still need integration rebases as those older branches are refreshed.No full-project suite, Linux/macOS run or new title benchmark is claimed. This submission does not establish a GTA FPS or RAM reduction.
Related stale branches #5925, #7642, #9508 and #10193 change pipeline scheduling or descriptor handling; they do not provide the same per-key build ownership. CMake-only neighbors add different test targets.
Review follow-up (2026-11-03)
Integrated current main
4f41f4c375. Addressed the waited-hitstoreHashissue reported by chitters2004 and oneandonlydean: the successful lookup after acquiring the per-key build mutex now sets*storeHash = hash, matching the other successful shared-cache return paths.The existing concurrent store fixture now captures both threads' returned hashes and requires the waited hit's hash to be nonzero and equal to the builder's. With the new assertions and the previous implementation,
agc_pipeline_store_builds_sharedfails witha completed lookup did not return its store hash; with the fix it passes, including 10 repeated runs.Windows 10.0.26200.9457, WinLibs GCC 15.2 Release, NVIDIA GeForce RTX 3080 / 610.47:
Pipeline.cppandPipelineLibrary.cppwere restored from main4f41f4c375for this baseline; the PR's test registration remained in the build tree.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,ANYPS5_GPU=NVIDIA,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandVK_LAYER_PATH=C:\VulkanSDK\1.4.363.0\Bin. Neither log contains a missing-requested-layer warning or aVUID-error.check_conventions.py --base origin/mainandgit diff --checkpass.No new full-suite, Linux, macOS or title-performance result is claimed for this push. The older validation below remains pinned to its original revisions.
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)