perf(shader): skip log2 correction outside the near-one range #10336
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10336"
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:19Z.
What
The
log2lowering evaluates its eight-term near-one correction for every input, including inputs outside the range where that correction can be selected. This adds unnecessary shader work to the startup/menu rendering in God of War Sons of Sparta (PPSA28997).abs(x - 1) <= 1/8, reusing the structured conditional-emission helper.580ac0847.This is a small optimization and does not resolve the full reported 11 FPS problem. No system-library exports are added.
The former #8612 overlap is merged. The rebase retains its
ExactSub/ExactMulhelpers.Tested
Cooled matched repeats on 2026-10-25 UTC: main
2742004ed28fversus exact PR head5d0cddb50e2c. 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.
2742004ed28f5d0cddb50e2c2742004ed28f5d0cddb50e2c2742004ed28f5d0cddb50e2c2742004ed28fPresent-weighted mean GPU time: 33.5922 → 33.1057 ms/present, 0.4865 ms (1.45%) lower. PR p99 range: 37.850–38.583 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 PR5d0cddb50eImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T21:01:13Z.
Review: APPROVED
Reviewed exact head
d7bb63bb3b951df45294c34cc0c63028577736f9.EmitFPLog2still computes the nativelog2result and the same inclusiveabs(x - 1) <= 1/8gate;Log2SeriesNearOne, the four-ULP comparison and the selected results are unchanged, but series work is emitted only in the near branch. The four added boundary inputs cover the adjacent f32 values on both sides of the lower and upper cutoffs.I manually checked the overlapping math-emitter hunks from #4072, #5021 and #7410; none changes
EmitFPLog2or the near-one correction. Conventions andgit diff --checkpass. The author reports all six paired Linux/RADV runtime fixtures passing with Khronos validation and provides four fresh traces. The report limits its 1.51% mean GPU result to the tested startup menu on one GPU and does not claim broad gameplay gains. Product jobs are skipped by policy, and I could not rerun the Vulkan test locally because this environment has no GPU device. I found no blocker.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T21:04:07Z.
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 log2 boundary/runtime tests 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.