Skip to content

perf(shader): share the cosine fallback polynomial - #13268

Merged
oneandonlydean merged 2 commits into
boykopovar:mainfrom
Filip722:perf/shader-small-reduction-20261030
Nov 1, 2026
Merged

oneandonlydean merged 2 commits into
boykopovar:mainfrom
Filip722:perf/shader-small-reduction-20261030

Conversation

@Filip722

@Filip722 Filip722 commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

What

EmitFPCos evaluates the same six-FMA cosine polynomial for the low and high ranges, then selects one result. Select the argument first so those ranges share one evaluation, reducing generated native code without changing the accuracy correction.

  • Keep the exact multiply/FMA sequence, coefficients, sign selection, middle sine polynomial, four-ULP guard and near-zero handling.
  • Extend the existing sine/cosine reduction fixture with signed inputs around the 1/8- and 3/8-turn boundaries.

This does not change the guest instruction semantics introduced in #3770 (3a3504850a), the exact cycle reduction in #1979, or the near-zero behavior in #2380 (909281c994). The transformation uses per-lane SPIR-V OpSelect with identical arithmetic on the selected input; the fused exact-arithmetic path remains intact. No new console behavior is inferred.

Tested

2026-10-31 current-main confirmation: inconclusive; no established gameplay gain.

Existing PR13268, unchanged production mechanism, measured alone. Fresh main b7d3fd3 versus local merge166b91ac75f4 of the original PR head26597cbde592. The local merge is preserved but not pushed. Public parent revisions and exact tree/patch hashes are in merge-provenance.json.

Four paired reductions average 0.126054%; two-sided95%Student-t(df3)CI [-0.175159,0.427268]%. The lower bound is negative, so this does not establish gameplay improvement. No extra runs or unchanged repeat.

Pair Main mean ms Candidate mean ms Reduction %
1 45.696570342 45.728623574 -0.070143627
2 45.712482890 45.616875000 0.209150507
3 45.656722433 45.649547529 0.015714893
4 45.725749049 45.565939394 0.349495982

Mean frame time 45.697881179→45.640246374ms; mean run FPS separately 21.882859683→21.910523162. Within-arm ranges 0.069026616/0.162684180ms, sample SDs 0.029919831/0.068227046ms.

Allten fixed-order attempts valid, eighttimed, no exclusions or replacements. Same savedcamp/Continue route, guest1920x1080, Wayland1152x648client/mailbox, matched focus/cache/input/provenance. 51native libraries and9unique guestmodules namespace-hashed withduplicatechecks, actualRADVICDverified. Nativecount51 includesupstreamAudio3d libkernel_sys dependency. Botharms differonlyAGC andVideoOutrevisiontext. No validation/profiling duringtiming; stdoutPTY; no drops.

AMD Ryzen5 7640HS / Radeon760M integratedsharedmemory GPU, RADV Mesa25.0.7-2+deb13u1, Debian13.7, Linux7.2.12-x64v3-xanmod1. Three matched Radeon fixtures pass with Khronos instance/device insertion, no skips/missinglayers/VUIDs. 29184bitidentical trigoutputs, unsupportedmodes unchanged. No currentnativecode/occupancy or full-gamecleanvalidation claim.

The historical two-pair result observed +0.608%FPS on olderbase, with acknowledged uncertainty; it is retained in the previous evidence Gist and not pooled with this cohort. Its untimed trace-capacity failure and expectedrevisionlabel correction remain disclosed there. This fresh outcome is not a universal regression or benefit. No combined-patch inference.

Each gzip trace is losslessly base64wrapped. Decode, verifySHA256 in provenance.json, then decompress. All8 summaries and trace_digest reports supplied. Only timings, protocol, digests, hashes and our measurement-hook source are public; no gamefiles, saves, shaders, ISA, screenshots, hardwarecaptures orconsolelogs. AI-assisted:yes(Codex).

All fresh traces, summaries, trace_digest reports, protocol and provenance.

Primary metric: window duration / presents per run. Fixed order: warm A, warm B, A1, B1, B2, A2, B3, A3, A4, B4. Individual frames are not independent repetitions. Fresh matched main/candidate/final hook-free fixtures: SinCosReduction, SinCosNearZero, Vop1FloatUnary. Trace dirty:null records dependency-symlink status failure; exact source and binary provenance is retained. Identical readiness-only hooks run outside timing and are absent from production. Historical full-game vertex/index binding VUIDs remain; no clean full-game validation claim.

Fresh main/candidate summary lines and trace_digest excerpts
{"commit":"b7d3fd3c5218","dirty":null,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"30:12"},"gpu":"AMD Radeon 760M (RADV PHOENIX)","driver":"radv Mesa 25.0.7-2+deb13u1","os":"Linux 7.2.12-x64v3-xanmod1","cpu":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics","cpu_threads":12,"memory_mib":23820,"title_id":"PPSA28997","title":"God of War Sons of Sparta","content_version":"01.008.001","resolution":"1920x1080","window":{"spec":"seconds 30:12","first_present":662,"ms":12018.198},"presents":263,"frame_ms":{"p50":45.627,"p90":46.196,"p99":46.911,"max":47.275},"gpu_busy_ms_per_present":42.678,"worker_busy_pct":{"queue worker 0x0":78.378},"top_phases_ms_per_frame":{"Driver.Packet":35.694,"Driver.Packet.draw":33.301,"Driver.Draw":33.263,"Driver.Draw.draw_enqueued":29.515,"Recorder.Sync":28.586,"VideoOut.Flip":9.045,"Driver.Present":9.038,"VideoOut.Flip.present":9.011},"trace_dropped":false,"trace":"aps5-trace-b7d3fd3c5218-278807.json.gz"}
{"commit":"166b91ac75f4","dirty":null,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"30:12"},"gpu":"AMD Radeon 760M (RADV PHOENIX)","driver":"radv Mesa 25.0.7-2+deb13u1","os":"Linux 7.2.12-x64v3-xanmod1","cpu":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics","cpu_threads":12,"memory_mib":23820,"title_id":"PPSA28997","title":"God of War Sons of Sparta","content_version":"01.008.001","resolution":"1920x1080","window":{"spec":"seconds 30:12","first_present":611,"ms":12026.628},"presents":263,"frame_ms":{"p50":45.643,"p90":46.385,"p99":47.166,"max":47.483},"gpu_busy_ms_per_present":42.544,"worker_busy_pct":{"queue worker 0x0":78.329},"top_phases_ms_per_frame":{"Driver.Packet":35.689,"Driver.Packet.draw":33.149,"Driver.Draw":33.11,"Driver.Draw.draw_enqueued":29.46,"Recorder.Sync":28.293,"VideoOut.Flip":9.027,"Driver.Present":9.017,"VideoOut.Flip.present":8.99},"trace_dropped":false,"trace":"aps5-trace-166b91ac75f4-279552.json.gz"}

seconds 30:12 from present 662: 263 presents, frame p50 45.6 / p90 46.2 / p99 46.9 / max 47.3 ms, GPU busy 42.7 ms per present
AMD Radeon 760M (RADV PHOENIX), radv Mesa 25.0.7-2+deb13u1, Linux 7.2.12-x64v3-xanmod1, 1920x1080, commit b7d3fd3, dropped: no

seconds 30:12 from present 611: 263 presents, frame p50 45.6 / p90 46.4 / p99 47.2 / max 47.5 ms, GPU busy 42.5 ms per present
AMD Radeon 760M (RADV PHOENIX), radv Mesa 25.0.7-2+deb13u1, Linux 7.2.12-x64v3-xanmod1, 1920x1080, commit 166b91ac75f4, dropped: no

Conventions pass for this evidence update. A fresh scan covers1,593open PRs; the two stale shared-file comparisons (#5021 lane/NaN, #12324 wave-scan) were manually reviewed and are unchanged, with no cosine-sharing overlap or required dependency. The PR code/head stays26597cbde592; no timing is transferred to later maincf5a1805e50c.

Earlier 2026-10-30 evidence (retained unchanged below; separate protocol and revisions):

AMD Radeon 760M / RADV Mesa 25.0.7-2+deb13u1, Debian 13, Linux 7.2.12-x64v3-xanmod1; GCC 15.2.0 Release with SPIRV-Tools enabled and the default minimal optimizer.

The same three focused fixtures pass on current main 25dd440de1 and final candidate 26597cbde592: agc_driver_sin_cos_near_zero, agc_driver_sin_cos_reduction (including this PR's boundary cases on both arms), and agc_driver_vop1_float_unary. Both arms ran verbose ctest with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. Logs confirm actual Radeon execution and validation-layer insertion for all three fixtures, with no missing-layer warning, skip or VUID error. Earlier paired checks on the measured source also pass. CI and other GPUs have not been tested.

A driver-compiled synthetic sine/cosine kernel changes from 193 to 187 native instructions, 1,188 to 1,140 code bytes, and 48 to 32 allocated VGPRs. SGPRs stay at 128, branches at four, spills/scratch at zero, and reported theoretical subgroups/SIMD at 16. This is a synthetic native-code reduction, not captured linked gameplay ISA or a demonstrated occupancy gain. Five supported float-mode/fused-arithmetic settings produce 11,200 bit-identical sine/cosine outputs from 5,600 inputs; all ten emitted SPIR-V modules validate. The fused path was exercised on RADV; actual MoltenVK hardware was not tested.

PPSA28997 (God of War Sons of Sparta 01.008.001), stationary camp, prospective A1/B1/B2/A2 after one warmup per arm. All four captures pass scene, focus, save/input, loaded-library, cache and trace-drop audits. Main: 20.88761 FPS (20.87920–20.89602); candidate: 21.01464 FPS (20.96757–21.06174), observed +0.608%; pairs +0.793% and +0.423%. Mean GPU time: 44.2795 to 44.1280 ms/present. Two short pairs do not establish a significant or general gameplay speedup. The claim is the native-code reduction.

All four lossless traces, summaries, full trace_digest output, protocol, provenance hashes, synthetic statistics and validation comparison. Traces are base64-wrapped for Gist; the attached decoder checks original byte length and SHA256. No game-derived shader, ISA, save, screenshot, hardware capture or console log is published.

The first excluded baseline warmup's 30-second trace exceeded the default event capacity after 25.818 seconds. Before any measured pair, the windows were shortened to 12 seconds, with no buffer override; that warmup's timing is excluded. A 13-character expected commit abbreviation was also corrected to upstream's 12-character label after source/loaded-library verification, without editing traces or repeating a run. Both changes are disclosed in the protocol.

Measured revisions are a5939f10a85f and 55c0d6a1d776, with the identical attached first-present clock/screenshot hook; dirty:true honestly records that hook. Only AgcDriver differs between arms; the other 49 loaded support libraries are identical. Timed windows use only APS5_TRACE_SECONDS=90:12 and APS5_TRACE_DIR, with no validation/profiling or competing builds. Console output stays on a PTY; screenshots bracket timing. The final branch merges current main's unrelated export inventories: shader, AGC, VideoOut, kernel and libc sources are byte-identical to the measured counterparts, as recorded in the evidence. The gameplay timings are not relabeled as testing the final merge.

Summary lines in order A1, B1, B2, A2:

{"commit":"a5939f10a85f","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"90:12"},"gpu":"AMD Radeon 760M (RADV PHOENIX)","driver":"radv Mesa 25.0.7-2+deb13u1","os":"Linux 7.2.12-x64v3-xanmod1","cpu":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics","cpu_threads":12,"memory_mib":23820,"title_id":"PPSA28997","title":"God of War Sons of Sparta","content_version":"01.008.001","resolution":"1920x1080","window":{"spec":"seconds 90:12","first_present":2374,"ms":12011.858},"presents":251,"frame_ms":{"p50":47.848,"p90":48.319,"p99":48.823,"max":48.949},"gpu_busy_ms_per_present":44.272,"worker_busy_pct":{"queue worker 0x0":79.116},"top_phases_ms_per_frame":{"Driver.Packet":37.699,"Driver.Packet.draw":34.645,"Driver.Draw":34.595,"Driver.Draw.draw_enqueued":30.327,"Recorder.Sync":28.793,"VideoOut.Flip":9.229,"Driver.Present":9.209,"VideoOut.Flip.present":9.182},"trace_dropped":false,"trace":"aps5-trace-a5939f10a85f-3404665.json.gz"}
{"commit":"55c0d6a1d776","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"90:12"},"gpu":"AMD Radeon 760M (RADV PHOENIX)","driver":"radv Mesa 25.0.7-2+deb13u1","os":"Linux 7.2.12-x64v3-xanmod1","cpu":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics","cpu_threads":12,"memory_mib":23820,"title_id":"PPSA28997","title":"God of War Sons of Sparta","content_version":"01.008.001","resolution":"1920x1080","window":{"spec":"seconds 90:12","first_present":2160,"ms":12012.302},"presents":253,"frame_ms":{"p50":47.466,"p90":48.002,"p99":48.415,"max":48.557},"gpu_busy_ms_per_present":44.104,"worker_busy_pct":{"queue worker 0x0":78.979},"top_phases_ms_per_frame":{"Driver.Packet":37.333,"Driver.Packet.draw":34.412,"Driver.Draw":34.362,"Driver.Draw.draw_enqueued":30.374,"Recorder.Sync":28.996,"VideoOut.Flip":9.22,"Driver.Present":9.204,"VideoOut.Flip.present":9.176},"trace_dropped":false,"trace":"aps5-trace-55c0d6a1d776-3406187.json.gz"}
{"commit":"55c0d6a1d776","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"90:12"},"gpu":"AMD Radeon 760M (RADV PHOENIX)","driver":"radv Mesa 25.0.7-2+deb13u1","os":"Linux 7.2.12-x64v3-xanmod1","cpu":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics","cpu_threads":12,"memory_mib":23820,"title_id":"PPSA28997","title":"God of War Sons of Sparta","content_version":"01.008.001","resolution":"1920x1080","window":{"spec":"seconds 90:12","first_present":2401,"ms":12018.562},"presents":252,"frame_ms":{"p50":47.708,"p90":48.159,"p99":48.643,"max":50.423},"gpu_busy_ms_per_present":44.152,"worker_busy_pct":{"queue worker 0x0":79.058},"top_phases_ms_per_frame":{"Driver.Packet":37.546,"Driver.Packet.draw":34.524,"Driver.Draw":34.474,"Driver.Draw.draw_enqueued":30.285,"Recorder.Sync":28.985,"VideoOut.Flip":9.211,"Driver.Present":9.194,"VideoOut.Flip.present":9.166},"trace_dropped":false,"trace":"aps5-trace-55c0d6a1d776-3407628.json.gz"}
{"commit":"a5939f10a85f","dirty":true,"env":{"APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"90:12"},"gpu":"AMD Radeon 760M (RADV PHOENIX)","driver":"radv Mesa 25.0.7-2+deb13u1","os":"Linux 7.2.12-x64v3-xanmod1","cpu":"AMD Ryzen 5 7640HS w/ Radeon 760M Graphics","cpu_threads":12,"memory_mib":23820,"title_id":"PPSA28997","title":"God of War Sons of Sparta","content_version":"01.008.001","resolution":"1920x1080","window":{"spec":"seconds 90:12","first_present":2407,"ms":12021.533},"presents":251,"frame_ms":{"p50":47.941,"p90":48.416,"p99":49.116,"max":52.213},"gpu_busy_ms_per_present":44.287,"worker_busy_pct":{"queue worker 0x0":79.146},"top_phases_ms_per_frame":{"Driver.Packet":37.745,"Driver.Packet.draw":34.688,"Driver.Draw":34.639,"Driver.Draw.draw_enqueued":30.497,"Recorder.Sync":28.887,"VideoOut.Flip":9.219,"Driver.Present":9.193,"VideoOut.Flip.present":9.166},"trace_dropped":false,"trace":"aps5-trace-a5939f10a85f-3409147.json.gz"}

Convention checks pass. The required overlap check reports no direct overlap; its three conflicting shared-file PRs (#5021, #11351, #12324) were reviewed manually and change lane shuffles/NaN tests, f16 conversion, and wave64 scan proofs respectively, with no cosine polynomial change.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: AMD Radeon 760M (AMD, device 1002:15bf), RADV Mesa 25.0.7-2+deb13u1, Debian 13 / Linux 7.2.12-x64v3-xanmod1
  • AI-assisted: yes

@github-actions github-actions Bot added the perf Performance change label Oct 30, 2026
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

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.

Pull request Shared files not compared
PR 5021 core/shader/recompiler/SpirvBackend/src/SpirvAlu/SpirvAluEmitterMath.cpp
PR 7410 core/shader/recompiler/SpirvBackend/src/SpirvAlu/SpirvAluEmitterMath.cpp
PR 11351 core/shader/recompiler/SpirvBackend/src/SpirvAlu/SpirvAluEmitterMath.cpp
PR 12324 core/shader/recompiler/SpirvBackend/src/SpirvAlu/SpirvAluEmitterMath.cpp

@JJenkx

JJenkx commented Oct 30, 2026

Copy link
Copy Markdown
Contributor

Windows GPU run of head 26597cbde5, merged onto main 1c6b316cf7 (clean merge, local only).

Windows 11 Enterprise 10.0.22621, Ryzen 9 5950X, Radeon RX 6700 XT with AMD proprietary driver 26.10.1 (Vulkan 1.4.315), WinLibs GCC 15.2.0 UCRT r7, Ninja, Release, BUILD_TESTING=ON. Khronos validation layer 1.4.309 requested for every test (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation).

  • agc_driver_sin_cos_reduction, built from the test files this PR changes: pass, 3 of 3 runs each (--repeat until-fail:3), no failures, no skips.
  • They create Vulkan instances on the RX 6700 XT: the validation layer was inserted 3 times across the runs and reported no VUIDs.

AI-assisted: yes (Claude Code).

@github-actions github-actions Bot added shader core/shader agc libSceAgc* labels Oct 31, 2026
@TechLevelZero

Copy link
Copy Markdown
Contributor

✅ NVIDIA GPU test: passed

PR head 26597cb merged onto main 6b48aee · tested 2026-10-31 02:06 UTC · 16 min

GPU NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Vulkan 1.4.329
Host Ubuntu 26.04.1 LTS, kernel 7.0.0-38-generic, container ubuntu:24.04
Logs build and test logs for this run
Build ✅ passed (Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON)
Tests ✅ 2,314 passed · 4 failed (0 new, 3 also fail on main, 1 unstable on main) · 41 skipped (ANYPS5_REQUIRE_VULKAN=1)
Test setup CPU-only tests without a GPU; GPU tests (and any CPU-only test that failed or skipped without one) once on the GPU with VK_LAYER_KHRONOS_validation and ANYPS5_NO_SHADER_CACHE=1; main ran the same way
Test selection 2,359 of 3,041 tests run: the ones this change can reach, chosen by tools/select_tests.py from main's build graph
Vulkan validation ✅ no new validation IDs vs main (863 tests run on the GPU)
Slow tests (>30 s, GPU tests timed with validation layers) ⚠️ agc_driver_bda_device 55.3 s, ⚠️ agc_driver_graphics 34.0 s, ⚠️ agc_driver_graphics_maps_fallback 30.9 s
Unstable on main (1, these also failed in recent main runs on this machine; not counted against this PR)
agc_driver_submit_progress: failed in 6 of the last 10 main runs
Failing on main too (3, not counted against this PR)
agc_submit_progress_no_timeline
guest_mmap_executable
guest_socket_options_multicast
Validation IDs already present on main (3 IDs in 380 tests)
VUID-VkDeviceCreateInfo-pNext-pNext (380 tests): agc_compute_pipeline_replay, agc_driver, agc_driver_address_passes, agc_driver_address_passes_draw_transitions, agc_driver_address_passes_targets_split, agc_driver_alias_copy_label, agc_driver_alpha_to_coverage, agc_driver_array_layer_target, and 372 more
VUID-vkCmdCopyImage-srcImage-01548 (12 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_sampling, and 4 more
VUID-vkCmdCopyImage-srcImage-01551 (12 tests): agc_driver_depth_clear_hle, agc_driver_depth_plane_buffer_memory, agc_driver_depth_plane_cpu_write_after_memo, agc_driver_depth_plane_cpu_write_after_page_unwatch, agc_driver_depth_plane_cpu_write_after_partial_unwatch, agc_driver_depth_plane_partial_store, agc_driver_depth_plane_partial_store_unimported, agc_driver_depth_plane_sampling, and 4 more
Skipped (41)
agc_driver_bda_reads_shadowed_results: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_bda_reads_shadowed_results_per_build: skipped, the device reports watched host memory written when it imports or reads it
agc_driver_msaa_dcc_compared_import_2: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_4: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_msaa_dcc_compared_import_8: skipped, the device reports host imports that keep write protection, so the write-watch probe compares none of them
agc_driver_sample_order_grid_reference: skipped, the device does not keep depth drawn at custom sample locations at those locations, even after a transition that names them: the composite of uniform renders holds the guest's depth in 0 of 3005 sloped samples, so no path can be compared with it bit for bit
agc_driver_stencil_ref_export: skipped, the device lacks VK_EXT_shader_stencil_export
agc_driver_vertex_elected_atomic_max: skipped, the device runs vertex programs in subgroups, so they keep their cross-lane reductions
agc_host_import_sparse: skipped, host imports are unavailable: /dev/udmabuf is not accessible
agc_import_settle_initial_dcc: skipped, the device has no deferred settle of host imports: imports under 1 MiB wait for one only on Windows
agc_unit_shadow_completion_store: skipped, the device reports watched host memory written when it imports or reads it
guest_http_uri_locale: 
guest_net_ctl: skipped, the host has no IPv4 address
guest_video_out_color_space: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_hdr: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_high_frame_rate: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_output_mode: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_resolution_status: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
guest_video_out_wqhd_detection: skipped, no display or Vulkan device: SDL_InitSubSystem(VIDEO | GAMECONTROLLER) failed: wayland,x11 not available
video_out_flip_controls: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_cpuflip_in_order: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_aftergpu: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_eop_main: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_fresh: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is either not configured in SDL or not available in current SDL video driver (offscreen) or platform
video_out_flip_labels: skipped, no display or Vulkan device: DisplayWindow: Vulkan support is eithe
Reproduce
git fetch origin 26597cbde592fb3d2e5b47728dbb4c0645c9123b 6b48aee5d2ea9fce6155163d78f8ce8dc84f7827
git checkout 6b48aee5d2ea9fce6155163d78f8ce8dc84f7827 && git merge --no-ff 26597cbde592fb3d2e5b47728dbb4c0645c9123b
git submodule update --init --recursive
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON
cmake --build build && cmake --build build --target libs
VK_DRIVER_FILES=/nonexistent/icd.json ctest --test-dir build -E '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 32 --output-on-failure
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation \
  ctest --test-dir build -R '^(agc|shader|recompiler|videoout|video_out|guest_video_out|vulkan)|gpu' --timeout 120 --parallel 4 --output-on-failure
# failures are then re-run alone: --timeout 360 --parallel 2; new validation IDs: the test alone, twice, --parallel 1

Automated 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.

@Filip722

Copy link
Copy Markdown
Contributor Author

@oneandonlydean @MarcZX10 Requesting a review decision on this optimization with the fresh confirmation report now in the description. Four predeclared pairs on main b7d3fd3c5218 versus local merge 166b91ac75f4 give mean frame-time reduction 0.126054%, with a two-sided 95% Student-t interval of [-0.175159%, 0.427268%]. This does not establish a gameplay gain. The local merge was not pushed, and these measurements do not claim validation of today's main or the unchanged published head on that later base.

The rationale remains selecting the cosine argument before evaluating its unchanged polynomial, sharing the evaluation rather than emitting it twice. The report retains all unfavorable results and exact timing provenance; I have not relabeled the optimization as a refactor or added repetitions to seek a positive result. The reported matched Radeon fixtures and 29,184-output comparison preserve correctness; the Windows AMD and NVIDIA reports add separately scoped coverage.

Would you accept this code/work reduction with the explicitly inconclusive gameplay result, or is another specific measurement required before it is worth landing? No new build, GPU run or capture is claimed by this follow-up.

AI-assisted: yes (Codex).

@oneandonlydean
oneandonlydean merged commit 3ead775 into boykopovar:main Nov 1, 2026
16 checks passed
@MarcZX10

MarcZX10 commented Nov 1, 2026

Copy link
Copy Markdown
Contributor

Re-checked — merged before review

GitHub shows #13268 merged at 2026-11-01T02:52:51Z with head 26597cbde592fb3d2e5b47728dbb4c0645c9123b, so I did not submit a post-merge review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* perf Performance change shader core/shader

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants