Skip to content

Make PSV/DebugBreak unit tests robust to validator version#8625

Merged
alsepkow merged 2 commits into
microsoft:mainfrom
alsepkow:fix-psv-debugbreak-unittests-main
Jul 16, 2026
Merged

Make PSV/DebugBreak unit tests robust to validator version#8625
alsepkow merged 2 commits into
microsoft:mainfrom
alsepkow:fix-psv-debugbreak-unittests-main

Conversation

@alsepkow

@alsepkow alsepkow commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

The PSV and DebugBreak unit tests hard-code the newest PSV runtime-info version, which is a latent fragility unrelated to any single release.

  • ValidationTest PSV tests hard-coded sizeof(PSVRuntimeInfo4) (and the literal string 56). That silently assumes the validator always emits the newest PSV struct. It is wrong for any validator < 1.10 (which emits PSVRuntimeInfo3), including downlevel/external-validator runs and any future shader-model cap. The expected size is now derived from the validator version via a GetExpectedPSVRuntimeInfoSize() helper.
  • PixTest::DebugBreakInstrumentation_{Basic,Multiple} hard-code cs_6_10; they now skip when Dxil/Validator < 1.10.

This is behavior-preserving on main (validator is 1.10 there, so PSV v4 is still expected and the tests still run), while removing the fragility. The latent bug was introduced in #7871, which added PSVRuntimeInfo4 and the < 1.10 -> v3 gating together; main has always run validator 1.10 since, so the v3 path was never exercised.

Intended to be cherry-picked to release-1.9.2607 (where #8618 caps the validator to 1.9), unblocking the SM 6.9 cap.

Assisted by co-pilot

alsepkow and others added 2 commits July 15, 2026 13:34
Capping the highest shader model to 6.9 (PR microsoft#8618) lowers the validator
version to 1.9, so the compiler emits PSVRuntimeInfo3 (52 bytes) instead
of PSVRuntimeInfo4 (56 bytes) and rejects cs_6_10, which broke 14 unit
tests.

- PixTest DebugBreakInstrumentation_{Basic,Multiple}: skip when Dxil/
  Validator < 1.10 (DebugBreak is an experimental SM 6.10 feature).
- ValidationTest PSV tests: derive the expected PSVRuntimeInfo size from
  the validator version (v4 only for >= 1.10, else v3) instead of
  hard-coding sizeof(PSVRuntimeInfo4), and format the expected size into
  the WrongPSVVersion mismatch messages.

Validated locally against a capped x64 build: the 14 tests pass, and the
full ValidationTest + PixTest suites (302) and clang FileCheck lit suite
show no failures.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 086148ba-a82b-41c4-8fa0-5eb63e5797e2
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 942a5e5f-0252-472b-9529-7218fdab7664
@alsepkow

Copy link
Copy Markdown
Contributor Author

I have a draft PR running here which has these changes plus the version change: #8623

This gives us proper validation of the change pre checkin.

@alsepkow
alsepkow enabled auto-merge (squash) July 15, 2026 23:54
@alsepkow
alsepkow merged commit 4e5d61e into microsoft:main Jul 16, 2026
16 checks passed
@github-project-automation github-project-automation Bot moved this from New to Done in HLSL Roadmap Jul 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants