perf(shader): use 32-bit scalar buffer bounds #10337
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10337"
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 Filip722 on 2026-10-23T18:26:22Z.
What
Scalar-buffer loads currently use 64-bit multiplication and comparison to check descriptor ranges, adding native GPU work in the Sons of Sparta menu. This change uses the low and high halves of a 32-bit extended product for the same bounds decision.
Tested
Cooled matched repeats on 2026-10-25 UTC: main
2742004ed28fversus exact PR head50b32c145c0c. Four main controls and three independent PR repeats; code and original patch are unchanged. The other performance PR is not included.The earlier mini-PC setup was thermally stressed, reaching 99–101°C on the GPU, and the captures lacked continuous focus verification. Those thermal conditions limited confidence in the earlier comparison. After a cooling upgrade, a six-minute baseline preflight found no thermal/PROCHOT flags in 1,441 samples. The new valid repeat cohort peaks at GPU 81°C and CPU package Tctl 80.875°C, with zero sampled thermal flags and 2599 MHz GPU clock throughout its timed windows. The old captures did not record firmware throttle flags, so thermal throttling is not a proven cause of the old stalls.
Same PPSA28997 version 01.008.001 startup menu, converted executable, copied save seed and per-commit warmed shader/Mesa caches. Radeon 760M (RADV PHOENIX), Mesa 25.0.7-2+deb13u1, Debian 13 / Linux 7.2.10-x64v3-xanmod1, GCC 15.2.0. Wayland window 1152×648, guest 1920×1080. Each run starts with GPU/package ≤53°C for 10 seconds. Cross at 45 seconds; trace window
90:30lets startup activity settle. Existing GPU power modehighwas left unchanged. No SQTT/RGP, hardware profiling lock, extra profile/trace switch, validation or timing interception layer was used during measurement; output used a PTY.Window activation and geometry changes were monitored continuously. The ten valid captures remained active at 1152×648 throughout their measurement windows; all pre/post scene images were inspected locally and show the same menu. Two attempts failed the predeclared focus rule and remain disclosed: S2 p99 37.586 ms lost focus and was replaced by S2r; A4 p99 39.402 ms had a 123 ms focus interruption and was replaced by A4r. Both were excluded regardless of favorable timings. Fixed accepted order: A1, L1, S1, A2, S2r, L2, A3, L3, S3, A4r. All other captures were retained.
Thermal metrics were sampled every 250 ms with a 96°C process guard. Package/current-limit flags and background GPU activity are retained in the audit. Runtime-library hashes match the exact builds; every summary is clean with no dropped events; all owned processes exited.
2742004ed28f50b32c145c0c2742004ed28f50b32c145c0c2742004ed28f50b32c145c0c2742004ed28fPresent-weighted mean GPU time: 33.5922 → 32.3687 ms/present, 1.2235 ms (3.64%) lower. PR p99 range: 37.440–37.749 ms; main controls: 38.390–39.435 ms. No frame over 50 ms occurred in the valid trace intervals. The earlier 60.851/67.350 ms p99 outliers did not reproduce.
The earlier same-head runtime-library builds and all six focused correctness fixtures passed independently on main and each PR with Vulkan required, shader cache disabled and Khronos validation actually loaded: no missing-layer warnings, skips or VUID errors. Conventions and whitespace checks pass. No production change was indicated by the repeat investigation. These results cover this menu on one GPU; they do not establish broader gameplay, cross-title or console behavior. Cooling, focus control and settling time changed together, so the repeats do not isolate the historical stall's cause.
Original traces, digests and results remain unchanged. The old A2 post-capture image selected another active window, was discarded, and is not claimed as scene verification. The original L1/S2 slow frames show long CPU-side packet-processing wall spans; that locates the delay on the host side but does not distinguish descheduling, waits or another cause.
Download the cooled-repeat traces, digests, all included/excluded summaries, thermal/focus telemetry, original-outlier analysis, thermal preflight and same-head correctness evidence. No game files, saves, screenshots, binaries or shader caches are included.
Full current summary lines, in capture order:
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)2742004ed2and PR50b32c145cImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T21:00:22Z.
Review: APPROVED
Reviewed exact head
33aaab29be4330ab6f0aa2309a94b97f540bac1c. The byte-size calculation is preserved asstride == 0 ? records : stride * recordsby using an effective stride of 1 andOpUMulExtended. Member 0 is the low-order product and member 1 the high-order product per the Khronos SPIR-V specification; the 4 GiB fixture exercises the high-member path. With 32-bit guest offsets, any nonzero high product word makes every aligned guest offset plus its four-byte read fit; when the high word is zero,byte < align_down(low, 4)is equivalent to the previousbyte + 4 <= size. The offset-addition carry, descriptor-validity predicate, fault/access paths and 64-bit BDA base addition are retained.The regression cases include zero, short, exact, strided, 4 GiB and larger ranges. The author reports all six focused runtime fixtures passing with Khronos validation on the exact head, plus the paired trace report; the report appropriately limits the 3.70% mean GPU result to this startup menu on one AMD GPU and says tail latency did not consistently improve. I independently checked the overlap hunks for #6412, #7484, #7642, #7689, #9508 and #10193; none changes this scalar-bounds calculation. Conventions and
git diff --checkpass.I could not rerun the Vulkan test locally because this environment has no
vulkaninfoor/dev/dridevice. Hosted product jobs are skipped by policy; the author-reported GPU results remain the available runtime evidence. I found no correctness blocker.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T21:04:04Z.
Review: CHANGES_REQUESTED
Follow-up to my earlier approval: after refreshing
upstream/main, this branch's merge base is11b175a6b956, with 7,168 current-main commits since it.CONTRIBUTING.mdasks contributors to keep branches up to date with main. The GPU fixtures and performance comparison in the PR were run on that older base, while current hosted product tests are skipped. Please update to current main and rerun the focused scalar-buffer runtime cases with Khronos validation, then refresh the paired performance comparison on the same current base. The reported result is carefully scoped, but it does not validate the current integration. I will revisit approval after current-base evidence is available.