Skip to content

test(setup): execute the D3D12 probe on real Windows and keep it running in CI (#248) - #274

Merged
lemon07r merged 2 commits into
masterfrom
devin/1788918975.37216-windows-d3d12-probe-evidence
Sep 9, 2026
Merged

lemon07r merged 2 commits into
masterfrom
devin/1788918975.37216-windows-d3d12-probe-evidence

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes the remaining blocker on #248: the D3D12 probe merged in #259 had never been executed on Windows. This PR records that execution and makes it recur in CI.

New Windows-only test the_real_probe_agrees_with_a_direct_d3d12createdevice_call (crates/vera-cli/src/commands/setup.rs). The hardware answer can't be pinned, so it pins the plumbing instead: d3d12.dll loads from System32, D3D12CreateDevice resolves, the transmuted ABI returns a documented null-ppDevice value (S_FALSE or a failing HRESULT — asserts it is never S_OK), and has_directx12_adapter() / directml_provider_for_d3d12(...) agree with that value's sign. It prints the raw HRESULT so every CI log is field evidence.

New CI job windows-probe on blacksmith-16vcpu-windows-2025 (same runner class release.yml already uses) running cargo test -p vera-cli --bin vera setup -- --nocapture, with the CFLAGS=/MD / CXXFLAGS=/MD workaround copied from release.yml (without it the test binary fails to link: esaxx-rs is MT_StaticRelease vs vera-core's scanner MD_DynamicRelease).

Evidence from this machine (Windows Server 2022, build 20348, d3d12.dll 10.0.20348.3451)

Adapters per dxdiag: IddSampleDriver Device and Microsoft Basic Display Driver, both DDI 12, feature levels 12_1…9_1.

D3D12CreateDevice(null adapter, 11_0, ID3D12Device, null ppDevice) -> 0x00000001
has_directx12_adapter() -> true
test result: ok. 12 passed; 0 failed; 0 ignored; 0 measured; 156 filtered out

So on real Windows the export resolves through the LoadLibraryExA/GetProcAddress/transmute path, success arrives as S_FALSE exactly as #259 predicted (an == S_OK check would have said "no"), and the probe selects DirectML.

Caveat worth a decision: this VM has no discrete GPU — only a virtual display adapter and the Basic Display Driver — yet D3D12 answers yes because WARP (the software rasterizer) is a D3D12 FL 12_1 device. DirectML does run on WARP, but slowly; if that's not the desired auto-select outcome on GPU-less VMs, the probe would need a further DXGI check (e.g. reject DXGI_ADAPTER_FLAG_SOFTWARE / the Basic Render Driver vendor id 0x1414). Not changed here.

Also observed (not changed)

cargo test -p vera-cli --bin vera (full, outside the setup filter) has 3 pre-existing failures on Windows unrelated to this PR: agent::tests::all_skill_paths_dedup_shared_directories, uninstall::tests::shim_candidates_track_non_default_cargo_home, uninstall::tests::an_ambiguous_shim_is_reported_and_blocks_the_complete_claim. The CI job is scoped to setup so it doesn't gate on those.

Link to Devin session: https://app.devin.ai/sessions/dc13943841be48759f3e2f6c1aed3f85
Open in Devin Desktop: https://app.devin.ai/desktop/session/dc13943841be48759f3e2f6c1aed3f85?variant=devin
Requested by: @lemon07r


Summary by cubic

Adds a Windows-only test that runs the D3D12 probe against the real d3d12.dll on a CI runner, so the probe’s behavior is verified on actual Windows instead of only cross-compiled.

  • The test pins the plumbing: D3D12CreateDevice resolves, a null ppDevice returns S_FALSE or a failing HRESULT (never S_OK), and has_directx12_adapter() / directml_provider_for_d3d12(...) agree with that value’s sign.
  • Prints the raw HRESULT so every CI log is field evidence.
  • Adds a windows-probe CI job on blacksmith-16vcpu-windows-2025 running the setup tests with the /MD CRT flags from release.yml.
  • Caveat: on GPU-less VMs, D3D12 still reports yes via WARP; if auto-selecting DirectML on WARP is undesired, a DXGI check (e.g. reject software adapters) would be needed. Not changed here.

Written for commit 27eb57a. Summary will update on new commits.

Review in cubic

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@lemon07r
lemon07r merged commit 3199aa0 into master Sep 9, 2026
4 checks passed
@lemon07r
lemon07r deleted the devin/1788918975.37216-windows-d3d12-probe-evidence branch September 13, 2026 08:18
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.

1 participant