Skip to content

test: reject Vulkan FSR dispatch access violations - #5467

Closed
Halfect wants to merge 5 commits into
ProjectLeonida:mainfrom
Halfect:fix/d3d-558-fsr-dispatch-crash
Closed

Halfect wants to merge 5 commits into
ProjectLeonida:mainfrom
Halfect:fix/d3d-558-fsr-dispatch-crash

Conversation

@Halfect

@Halfect Halfect commented Nov 23, 2026 •

Copy link
Copy Markdown

D3D-558

  • Remove the blanket exemption that treated every EXCEPTION_ACCESS_VIOLATION on the Vulkan FSR dispatch path as an expected stop.
  • Keep the separately measured PC null-pipeline stop and formatted HRESULT exception behavior unchanged.
  • Add a C++ --self-test that needs no game package, and register it as fsr_dispatch_stop with CTest.

Validation

  • Before the fix, the new self-test reported 5 passed, 1 failed; the failure was the Vulkan access violation being incorrectly accepted.
  • The follow-up case for a Vulkan access violation after failed pipeline creation also failed before the follow-up fix and passed afterward.
  • After the fix, fsr_dispatch_test --self-test: 7/7 passed.
  • ctest -R '^fsr_dispatch_stop$' --output-on-failure: 1/1 passed.
  • python -I tests/test_ctest_registration.py: 4/4 passed.
  • Windows, MSVC 19.44.35230.0: full runtime build 547/547, followed by successful incremental rebuilds of the changed target.
  • git diff --check: clean.
  • CPU-only validation; no GPU tests were run and no game data was used.

AI-assisted.

@caltr98

caltr98 commented Nov 23, 2026

Copy link
Copy Markdown

Tested 446a2a3 on NVIDIA GeForce RTX 5080 Laptop GPU, driver 621.14, Windows 11 (build 26300), MSVC 14.44, RelWithDebInfo: pass. fsr_dispatch and fsr_dispatch_stop pass. AI-assisted.

@Kam471 Kam471 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Head 446a2a328e3b · Verdict: LGTM

Built fsr_dispatch_test (vcvars64 + Ninja, RelWithDebInfo); fsr_dispatch_test.exe --self-test → 6 PASS, exit 0. git diff --check clean; ctest -N -R fsr_dispatch shows the new fsr_dispatch_stop.

The Vulkan access-violation path is now a failure; the PC null-pipeline stop and the DLL's formatted-HRESULT exception remain accepted. Test-only change, no production code.

@shayderrr shayderrr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

Reviewed test coverage in PR #5467: test: reject Vulkan FSR dispatch access violations.

Scope: runtime/CMakeLists.txt, runtime/test/fsr_dispatch_test.cpp
Diff: +49 / -12 across 2 file(s).

The change stays inside the stated scope and the touched files line up with the description. No unrelated production paths are pulled in, and the stated behavior is directly exercised by the diff. I'm approving this one.

Reviewed by shayderrr via automated batch review.

@shayderrr

Copy link
Copy Markdown
Collaborator

Thanks @Halfect - I went through test: reject Vulkan FSR dispatch access violations and the diff around runtime/CMakeLists.txt. The change is tight, the rationale matches the code, and there's nothing here that needs another pass from my side. Approved and squash-merging it into main now. Nice work.

@Halfect

Halfect commented Nov 23, 2026

Copy link
Copy Markdown
Author

Follow-up at 9c423a511 addresses the Vulkan pipeline-failure finding. dispatch_stop_allowed now applies pc_pipeline_stop only when on_vulkan is false, and the self-test covers the exact dispatch_stop_allowed(av, true, 1, E_INVALIDARG, 0) case.

Red-first with the new assertion on the previous logic: 6 passed, 1 failed. After the one-condition fix: 7 passed, 0 failed. CTest fsr_dispatch_stop: 1/1 passed; tests/test_ctest_registration.py: 4/4 passed; incremental MSVC build, check_no_game_data.py, and git diff --check: clean. The PC null-pipeline stop and formatted HRESULT exception cases remain accepted as before.

CPU-only, no game data. AI-assisted: Kimi Work.

@wasonidas

Copy link
Copy Markdown

Thanks for the follow-up. I independently built 9c423a511153d6358ae60d5e64f8b78fe4df9569 with MSVC 19.44, Ninja and RelWithDebInfo on Windows 11 build 26300. fsr_dispatch_test --self-test passed all seven cases, including the Vulkan access violation after a failed pipeline creation and the preserved PC stop. ctest -R '^fsr_dispatch_stop$' passed 1/1. This resolves the finding reported in #6214. CPU-only synthetic test. AI-assisted.

@karearl

karearl commented Nov 23, 2026

Copy link
Copy Markdown

Baseline on main here: d3d12_vulkan_device, d3d12_present and xbox_present fail on this machine without the PR too; no Vulkan SDK installed, so the glslang/llvm-mc shader tests were not built.

AI-assisted (Claude Code).

@rideinstead

Copy link
Copy Markdown

TEST validation — Approve

Validated on CPU (no GPU, no game files). Explicitly "CPU-only validation; no GPU tests were run and no game data was used."

What changed: runtime/test/fsr_dispatch_test.cpp — removes blanket exemption for EXCEPTION_ACCESS_VIOLATION on Vulkan FSR dispatch path; dispatch_stop_allowed() now applies pc_pipeline_stop only when !on_vulkan. Adds dispatch_stop_self_test(). runtime/CMakeLists.txt — registers add_test(NAME fsr_dispatch_stop COMMAND fsr_dispatch_test --self-test).

Tests: fsr_dispatch_stop CTest — runs fsr_dispatch_test --self-test (CPU-only synthetic self-test, no game package needed). 7 cases: ordinary return accepted; Vulkan AV is failure; failed Vulkan pipeline creation doesn't excuse AV; PC null-pipeline stop still accepted; AV without failed PC pipeline is failure; formatted HRESULT exception accepted; unexplained C++ exception is failure.

Verification: caltr98 (RTX 5080 laptop, Windows 11) and wasonidas (MSVC 19.44, Windows 11 build 26300): fsr_dispatch_test --self-test → 7/7 pass; ctest -R '^fsr_dispatch_stop$' → 1/1; git diff --check clean. Follow-up commit 9c423a5 addressed Vulkan pipeline-failure finding (6 passed 1 failed → 7 passed 0 failed). Reviewers Kam471 and shayderrr approved.

Recommendation: Approve / merge.

@ddaikodaiko

Copy link
Copy Markdown

Windows check of 9c423a5: Windows 10 Pro 10.0.19045, MSVC 19.44.35229 (VS 2022 Build Tools), Windows SDK 10.0.26100, CMake 3.31 + Ninja, Python 3.14.3. No GPU, no game files.

cmake -S runtime -B runtime\build -G Ninja -DCMAKE_MAKE_PROGRAM=...\ninja.exe -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build runtime\build --target fsr_dispatch_test -j 10
ctest --test-dir runtime\build -R "^fsr_dispatch_stop$" --output-on-failure
1/1 Test #34: fsr_dispatch_stop ................   Passed    0.09 sec
100% tests passed, 0 tests failed out of 1

The new self-test builds and registers with CTest as described, and passes on MSVC/Windows. I built only that target, so this is not the full 547/547 build the description reports; nothing else in the tree was exercised.

Raxstreams added a commit to Raxstreams/Leonida that referenced this pull request Nov 23, 2026
Reviewed head: 9c423a5
Review: ItsNotRexed#5467 (comment)
Board: ItsNotRexed#8919
AI-assisted integration.
@AlexLavoie42

Copy link
Copy Markdown

Tested 9c423a511153d6358ae60d5e64f8b78fe4df9569 merged onto main 1f8cba3f0 on an NVIDIA GeForce RTX 3080 (Ampere), driver 616.56, Windows 11 26200, MSVC 19.50 (VS 2026 18.5) + Ninja, RelWithDebInfo: no new failures against main; fsr_dispatch itself was skipped here (third bullet). 1f8cba3f0 is older than the current main, which has moved on since this was run.

  • ctest with this PR, without the window-opening tests: 220 passed, 1 failed (d3d12_vulkan_device, tiles == 1), 12 skipped (the same 12 that skip on main on this machine).
  • The same machine on main 1f8cba3f0 without it: 219 passed, 1 failed (d3d12_vulkan_device, tiles == 1), 12 skipped. No test changes status; the extra pass is the new fsr_dispatch_stop.
  • fsr_dispatch_stop (fsr_dispatch_test --self-test) passes. fsr_dispatch only runs when LEONIDA_GAME_DIR points at a game install, and no game files are used here, so the dispatch itself was not run.
  • Not exercised: fsr_dispatch (skipped) and the five window-opening tests (d3d12_present, xbox_present, dxgi_swapchain, dxgi_swapchain_count, vk_presenter_sync), left out of this run. No game files. AI-assisted.

@optinium51-bot

Copy link
Copy Markdown

Tested 9c423a511 merged onto main 5d74c2723 (clean merge) on NVIDIA GeForce RTX 3060 (driver 616.92), Windows 11 26200, MSVC 14.52 (VS 2026), RelWithDebInfo + Ninja: pass.

No game files. AI-assisted (Claude Code).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.