Repository navigation
feat(agc): source indirect instance user data from BaseInstance - #10359
valenciana-nc wants to merge 5 commits into
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
I reviewed the indirect-instance route selection, shader input mapping, cache/request identity changes, and the focused regression coverage. The candidate is narrowly gated to the indirect start-instance SGPR, excludes conflicting base-vertex/resource/decoded-input paths, and keeps CPU fallback for unsupported shader modes. The translator supplies Vulkan BaseInstance to that SGPR and subtracts it from Vulkan InstanceIndex, whose specified value starts at firstInstance (Khronos Vulkan spec: https://registry.khronos.org/vulkan/specs/latest/html/vkspec.html#interfaces-builtin-variables). The cache key and serialized request include the route, and the tests cover route changes, fallback, high-bit values and later SGPR writes.
The PR reports paired baseline/change execution of the focused suite on an RTX 4060 with validation layers, including the synthetic end-to-end regression. I did not rerun those GPU tests locally. Current hosted eligibility, conventions, intake, labels and report checks pass; product and relinker jobs are skipped by path policy. I found no blocking issue in the reviewed changes.
|
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.
|
ab78ab4 to
cf860e4
Compare
|
@MarcZX10 Thanks for the review. Main subsequently took request format 46, causing a serialization conflict. Resolved and pushed Fresh actual
New full logs, hashes, provenance and range-diff. Conventions/whitespace pass. The current external overlap is #9193's independent serialization change; I requested merge-order coordination, with no agreement or runtime dependency claimed. Incomplete older-PR comparisons remain disclosed. Description now distinguishes current evidence from the original head. No title/console/performance claim or hosted runtime success is added. AI-assisted. |
|
@valenciana-nc one non-blocking suggestion: |
|
Applied — instanceInputSgpr is now appended to the cache key only when it isn't -1, so ordinary requests keep the same keys as on main and existing cache entries stay valid. Verified with the indirect-instance and serializer tests on lavapipe (7/7, no new validation errors vs. the branch without this change). |
|
@valenciana-nc This PR now conflicts with main in |
91ee734 to
3d764f0
Compare
|
@oneandonlydean Resolved and pushed The integration keeps main's Also retained your cache-key suggestion and the 91ee734 follow-up, adding assertions that ordinary full/interface keys and source-memo identity stay unchanged while routed identities differ. Fresh actual Extra enabled traces verify 63 attempts / 126 stage selections with matching token/submission/queue/offset and no failure records; disabled correlation is tested with the variable unset. They are not a claim of complete indirect per-subdraw/submit attribution (batch=0/direct and unrecorded indirect tokens remain in those offscreen traces); this change preserves main's bookkeeping rather than inventing new tracing semantics. Full current evidence, traces, hashes and range-diff. Body updated; conventions and whitespace pass. #9193's author agreed this PR first; additional shared signature/serializer hunks remain disclosed and are being coordinated. Could you re-review the integration? No new title/console/performance or hosted-runtime claim. AI-assisted. |
|
Updated merge-order coordination after rebasing #10359 onto main
These are shared interface/layout integration points, not implementations imported into this runtime route or demonstrated runtime prerequisites. Current focused Vulkan evidence and complete scan, including incomplete older comparisons: https://gist.github.com/valenciana-nc/169b11c1bb69abe132356e61915d865c . AI-assisted coordination. |
|
@valenciana-nc Thanks, agreed: #10359 lands first with journal format 46/47 as you propose, and we'll renumber #10348 to format 48. |
3d764f0 to
a5a606e
Compare
|
@MarcZX10 @oneandonlydean Rebased to current main 74acfad, head a5a606e. Existing tracing/completed-subdraw integration, independent optional SGPR route, ordinary cache identity and format 46/47 behavior are retained. Fresh actual libs/test builds on RTX 4060 Laptop / NVIDIA 610.62 / Windows: main controls 9/9, updated head 15/15, plus 18/18 repeated new-mode/semantic executions. Required Vulkan/no-cache/Khronos validation active, no skips, VUIDs or missing-layer diagnostics. Body distinguishes this fresh scope from earlier trace/negative-control evidence and does not claim title or combined-stack validation. Could you re-review the current head? Logs: https://gist.github.com/valenciana-nc/535e87d2d74acfde062effdf1dd26c37 . AI-assisted. |
|
@oneandonlydean Fixed in Rebuilt actual libraries on the same RTX 4060 Laptop / NVIDIA 610.62 / Windows machine: main 13/13 controls (including depth-export clamp), PR 19/19, plus 18/18 repeated GPU-mode/semantic executions. Required Vulkan/no-cache/Khronos validation active, with zero skips, VUIDs, synchronization hazards, validation errors/warnings or missing-layer messages. A pre-push merge-tree preview against newer main Current-main scoped conventions and whitespace pass. The required older-fork |
MarcZX10
left a comment
There was a problem hiding this comment.
Re-checked — changes requested
What I checked
- Reviewed exact head
0f420f29bc99c951e80a7f8c49992ae10e148a35against fetchedmain2960e9a6e7. - The current-main merge preview is clean,
git diff --checkpasses, and the reviewed scope includes route gating, cache identity, and request-format compatibility. Hosted Windows, relinker, conventions, and eligibility checks pass; product Linux and specialized GPU jobs were skipped. - The author reports extensive exact-head Windows/NVIDIA validation for the pinned baseline
e4da19aff0, including 19/19 controls and 18/18 repeated GPU-route runs.
Blocking current-head validation
The tested runtime baseline is e4da19aff0; the newer main merge preview in the report is 319621ba2e, which the author explicitly says was an integration check rather than a runtime test. Fetched current main is now 2960e9a6e7, 297 commits ahead of this branch. Because this changes shader translation, cache identity, and serialized requests, a clean merge preview alone does not validate their interaction with the newer tree. Please refresh onto current main and rerun the focused serializer, shader-memory, and GPU-route tests with the validation layer on the refreshed integration head.
I found no new code defect in this read, but the previous approval predates this head and the current integration has not had runtime validation. I cannot renew approval until that evidence is available; I did not run GPU tests locally.
✅ NVIDIA GPU test: passedPR head
Intermittent validation messages (1, seen once in the parallel run, not reproduced when the test was re-run alone 2 times; not counted against this PR)Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)Failing on main too (5, 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 (4, not in the main baseline's validation pass)Validation IDs already present on main (4 IDs in 440 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. |
|
Landing order for the request serialization version: this PR, #12662 and #10846 all move it from 49 to 50. On #10846 we agreed that #12662 goes first and #10846 then takes 51. I propose the same here: #12662 goes first, and this PR takes the next number no merged PR uses when it merges AI-assisted: yes |
Re-checked — serialization order agreedThe consistent order is #12662, then #10359, then #10846, so their request formats can use 50, 51, and 52 respectively if no other version change lands first. Please record #12662 as a merge-order dependency on this PR; #10846 already lists both PRs ahead of it. |
|
An AMD RDNA 4 run on Windows of Windows 11 Pro 10.0.22631, AMD Radeon RX 9070 XT (
AI-assisted: yes (Claude Code) |
|
The serializer update on One coordination item remains: the description still says |
|
A data point from the title the Setup. Windows 11 Pro 10.0.26200, Ryzen 7 5800X3D (8C/16T), RTX 4070 (NVIDIA 610.88), WinLibs GCC 15.2.0, Release. The scene is renderer-only, built from tutorial (m08) assets; it boots straight into the scene with no input and needs no pad. All three builds carry a local equivalent of #6280's sampled-texture mip clamp, because without it
The branch is Sam-mon7/AnyPS5
{"commit":"6ba470367314","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_TRACE_SECONDS":"150:60"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 610.88","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 5800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32693,"title_id":"PPSA01341","title":"Demon's Souls","content_version":"01.007.000","resolution":"1920x1080","window":{"spec":"seconds 150:60","first_present":1181,"ms":60019.895},"presents":485,"frame_ms":{"p50":120.493,"p90":148.566,"p99":167.308,"max":181.695},"gpu_busy_ms_per_present":40.483,"worker_busy_pct":{"queue worker 0x0":96.046,"queue worker 0x20":94.878,"queue worker 0x28":94.584,"queue worker 0x30":93.662,"queue worker 0x38":90.946,"queue worker 0x40":94.670,"queue worker 0x48":90.428,"queue worker 0x50":94.933},"top_phases_ms_per_frame":{"Driver.Packet":925.106,"Driver.Packet.memory_wait":767.601,"Driver.Packet.dispatch":74.188,"Driver.Packet.draw":62.090,"Driver.Draw":61.747,"Driver.Dispatch":50.629,"Graphics.Draw":43.864,"Graphics.Draw.draw_and_resource_release":40.386},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":8.366,"events_lost":1563279,"totals_full":false},"draw committer":{"events_full_after_s":28.100,"events_lost":298814,"totals_full":false}},"trace":"aps5-trace-6ba470367314-211036.json.gz"}
{"commit":"5e670d92b336","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_TRACE_SECONDS":"150:60"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 610.88","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 5800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32693,"title_id":"PPSA01341","title":"Demon's Souls","content_version":"01.007.000","resolution":"1920x1080","window":{"spec":"seconds 150:60","first_present":697,"ms":60048.378},"presents":282,"frame_ms":{"p50":214.138,"p90":239.040,"p99":262.889,"max":286.314},"gpu_busy_ms_per_present":82.835,"worker_busy_pct":{"queue worker 0x0":97.546,"queue worker 0x20":96.888,"queue worker 0x28":96.636,"queue worker 0x48":94.311,"queue worker 0x50":97.565,"queue worker 0x30":96.142,"queue worker 0x38":94.226,"queue worker 0x40":96.993},"top_phases_ms_per_frame":{"Driver.Packet":1636.895,"Driver.Packet.memory_wait":1374.539,"Driver.Packet.draw":142.606,"Driver.Draw":142.216,"Driver.Packet.dispatch":95.513,"Graphics.Draw":68.439,"Graphics.Draw.draw_and_resource_release":64.881,"Driver.Dispatch":62.827},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":10.240,"events_lost":1268951,"totals_full":false}},"trace":"aps5-trace-5e670d92b336-216476.json.gz"}
{"commit":"73378664a738","dirty":false,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PIPELINE_INDIRECT":"1","APS5_TRACE_SECONDS":"150:60"},"gpu":"NVIDIA GeForce RTX 4070","driver":"NVIDIA 610.88","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 5800X3D 8-Core Processor","cpu_threads":16,"memory_mib":32693,"title_id":"PPSA01341","title":"Demon's Souls","content_version":"01.007.000","resolution":"1920x1080","window":{"spec":"seconds 150:60","first_present":859,"ms":60059.443},"presents":372,"frame_ms":{"p50":156.437,"p90":190.063,"p99":221.858,"max":284.937},"gpu_busy_ms_per_present":54.685,"worker_busy_pct":{"queue worker 0x0":97.017,"queue worker 0x20":96.009,"queue worker 0x28":95.807,"queue worker 0x30":95.030,"queue worker 0x38":92.781,"queue worker 0x50":96.334,"queue worker 0x48":92.647,"queue worker 0x40":95.708},"top_phases_ms_per_frame":{"Driver.Packet":1224.331,"Driver.Packet.memory_wait":1022.432,"Driver.Packet.dispatch":104.464,"Driver.Packet.draw":77.604,"Driver.Draw":77.277,"Graphics.Draw":63.054,"Graphics.Draw.draw_and_resource_release":60.021,"Driver.Dispatch":56.906},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":13.096,"events_lost":948026,"totals_full":false},"draw committer":{"events_full_after_s":31.806,"events_lost":232271,"totals_full":false}},"trace":"aps5-trace-73378664a738-184440.json.gz"}The three traces and their What changes on queue 0. The queue-0 worker is the critical path in this scene. Its trace buffer filled after 8-13 s in every run, so these per-frame figures come from that fully traced part.
Noise. These are single runs. The only other run of the So on this title the route needs at least #1896 to avoid inline recording. Even then it costs more per draw than the CPU path it replaces, at least in this scene. I can rerun against a newer head if that helps. AI-assisted: yes (Claude Code) |
…er as 51/52, tests and docs from main)
…(CMake tests from main)
What
Add a narrowly gated GPU-indirect vertex route for a numeric start-instance SGPR that cannot safely be folded into the instance index. The reported pattern
v8 + low16(s10)followed by an s10 overwrite comes from @ponhei9502 in #5806; this does not claim to close that issue or unblock a title.BaseInstance; initialize the guest instance index fromInstanceIndex - BaseInstance. Preserve guest masked arithmetic and later SGPR writes. Sources: Khronos BaseInstance and InstanceIndex; console-equivalence gaps remain in the library debt entry.asBase | asValue. Allocation failures still propagate.instanceInputSgprremains independent of tracing or heap state, and is assigned beforeInvocationFor.Current-main serialization conflict resolution
Main now owns formats 47/48/49, including format-49 depth-export bounds. This rebase preserves main's ordinary 49 bytes, format-47 dither semantics, format-48
fragmentBarycentricBuiltinsand format-49 depth fields. Only instance-input requests write 50, appending the SGPR after main's existing fields; the reader accepts through 50. Older main requests default to ordinary mode. Captures made with earlier versions of this PR's routed 46/47/49 layouts must be recaptured; those layouts are not interchangeable with main's formats.Updated tests cover both barycentric values, ordinary-49 byte round trips, main-47/48 replay defaults, routed-50 SGPRs 8/10/11/39, each 1–4-byte truncated route suffix, unexpected trailing bytes, a legacy-layout extra suffix and missing graphics context. Routed bytes must equal the corresponding ordinary request with only its version changed and SGPR appended. Depth-export enabled/disabled cases retain the flag and nondefault bounds (0.25/0.75 when enabled), independently of both barycentric values. Existing main depth/legacy fixtures stay unchanged. Both unsupported-future-version fixtures (
RequestSerializerTests.cppandShaderMemory.cpp) now reject 51.Ownership and merge-order coordination
This is independently authored GPU-route work, not #9243/#9248's CPU optimization. Historical scans/coordination identified shared materialization and serialization hunks, with incomplete older comparisons; no blanket overlap all-clear or combined-stack validation is claimed. #9193, #10846 and #10348's authors agreed #10359 first; #7642's author clarified it is stacked on #9508. Those are merge-order statements, not runtime dependencies or permission to reuse format 47. Subsequent integrations must preserve all main fields, keep numeric SGPR and heap state separate and allocate the next available layout. Earlier scan and coordination evidence.
The optional base-vertex extension offered by @mrfelek is not included in this rebase; it remains separate work, and its reported title/GPU measurements are not this PR's validation.
Tested
2026-10-28 rebase: pinned main
e4da19aff06e25ae16b90f460dff22e8ac1eb786, tested head0f420f29bc99c951e80a7f8c49992ae10e148a35. Windows 11 x86-64 build 26300, Intel i7-13650HX, NVIDIA GeForce RTX 4060 Laptop GPU / NVIDIA 610.62, WinLibs GCC 15.2.0 r7, Release,BUILD_TESTING=ON.Before pushing, a clean
git merge-treepreview against newer main319621ba2e578bd053b0baba2877fe70520e0737also succeeded; its ordinary serializer remains 49. That preview is an integration check, not a runtime test of the later main tip. Runtime counts below belong to the explicitly pinned baseline and head above.libsand affected executables rebuilt on main and this head.request_serializercovers the updated 47/48/49/50 compatibility matrix and depth-export fields described above.agc_shader_memoryincludes current main's depth, legacy and target-tail checks as well as the future-version rejection. These main fixtures were not blindly renumbered to the routed format.VUID-, synchronization hazards, or validation errors/warnings were found; this is not inferred from CTest's pass result alone.Exact same-machine GPU environment and common commands:
The PM4 fixture has a compute shader write draw records, then executes actual driver draws with exact-output/path checks. The semantic fixture checks wave32/wave64, high-bit bases, UINT32_MAX and later SGPR writes. GPU route, cache identity and tracing behavior are unchanged by this format-resolution follow-up. The base-vertex contributor extension was not imported or tested.
git diff --checkand scoped current-main conventions pass. The requiredpython tools/check_conventions.py --base origin/mainwas also run: both unmodified pinned main and this head return 1 with the identical inherited[commit-subject]finding for upstream revert97f1d41a2c(plus older-fork debt-length warnings). No PR-specific errors appear against current upstream main. The upstream revert was not rewritten and the stale fork tracking ref was not manipulated to hide this result. Current evidence is underoct28-*, including full commands, verbose logs, binary hashes, range-diff andoct28-provenance.json.resume-*and older artifacts are historical, not current-head evidence. Hosted checks from the prior head are not a current-head runtime pass.Earlier 27-test/negative-control/extra tracing evidence remains in the historical gist, not freshly repeated on this base. No commercial-title, console, other-GPU/OS, full-suite, combined-stack, speedup or complete per-subdraw trace-attribution result is claimed. An older approval is not independent exact-new-head validation. AI-assisted.
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)Local validation logs and scope.