Skip to content

test(gpu): probe heaps opened over process memory - #201

Merged
pragyaangaur merged 1 commit into
pragyaangaur:mainfrom
vedantdadhich21:test/inplace-heap-probe
Nov 26, 2026
Merged

pragyaangaur merged 1 commit into
pragyaangaur:mainfrom
vedantdadhich21:test/inplace-heap-probe

Conversation

@vedantdadhich21

Copy link
Copy Markdown
Contributor

Summary

Refs #197.

Adds ignored-by-default synthetic probes for the three D3D12 APIs that open a heap over memory the process already owns:

  • ID3D12Device3::OpenExistingHeapFromAddress
  • ID3D12Device13::OpenExistingHeapFromAddress1
  • ID3D12Device3::OpenExistingHeapFromFileMapping

The tests use only their own committed memory and buffer copies. They check interface availability, opening 64 KiB/4 MiB/256 MiB ranges, placed-buffer aliasing in both directions, VirtualProtect under an opened heap, and opening cost. They print results and do not fail on a host refusal, so a future D3DMetal or native host can be characterized without changing production code.

Credit: adapted by BennettStaley from the avatarmanz fork's GPL-3.0 inplace.rs probe; the original commit authorship is preserved and this adaptation is DCO signed off.

Verification

  • Native victory-gpu --lib: 85 passed, 1 ignored.
  • Wine ignored probe run: 5 passed. On local D3DMetal 3.0, Device3/Device13 query successfully, address openings return E_NOTIMPL, OpenExistingHeapFromAddress1 returns E_FAIL, and file-mapping openings return E_NOTIMPL, with no crash.
  • Strict all-target/all-feature Windows Clippy: passed.
  • cargo xtask policy: 234 files ok.
  • git diff --check: passed.

No game files or proprietary assets were used. AI-assisted adaptation and validation.

Ignored-by-default tests that ask the host D3D12 device for
OpenExistingHeapFromAddress, OpenExistingHeapFromAddress1 and
OpenExistingHeapFromFileMapping on 64 KiB, 4 MiB and 256 MiB of
committed memory, place a buffer over each heap that opens, check with
copies that the buffer aliases the memory both ways (and not as a
snapshot taken at open), try VirtualProtect under the heap, and time the
openings. Adapted from the avatarmanz fork's inplace.rs probe (GPL-3.0).

D3DMetal 4.0b3 under CrossOver Wine answers E_NOTIMPL for both
ID3D12Device3 openings and E_FAIL for OpenExistingHeapFromAddress1,
logging "Unsupported" for each, although both interfaces are exposed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Vedant Dadhich <vedantdadhich21@gmail.com>
@vedantdadhich21
vedantdadhich21 marked this pull request as ready for review November 26, 2026 01:47
@pragyaangaur
pragyaangaur merged commit b6dd0b1 into pragyaangaur:main Nov 26, 2026
1 check passed
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.

3 participants