Skip to content

Test dynamic slot reuse during alias retirement - #8

Closed
MichaelSmithAI wants to merge 1 commit into
r4tedx:shader/unknown-stride-view-kindsfrom
MichaelSmithAI:test/descriptor-retirement-order
Closed

MichaelSmithAI wants to merge 1 commit into
r4tedx:shader/unknown-stride-view-kindsfrom
MichaelSmithAI:test/descriptor-retirement-order

Conversation

@MichaelSmithAI

Copy link
Copy Markdown

This adds the deterministic allocator regression requested in #7, on top of the cherry-pick in 4e03086.

The test leases the entire dynamic pool of a real D3D12 view heap. As the final slot is being retired, it calls the production allocator at the start of alias cleanup, then performs the ordinary cleanup. It checks that the allocator can lease that slot only after retirement completes. The injected cleanup call fixes the interleaving without sleep or scheduler assumptions. Normal releases pass HostHeap::forget_view directly.

I ran the Win64 test binary on an RTX 4090 through Wine 11.22 and vkd3d-proton 3.1. Restoring the release order from 30a93f9 made the new test fail because it leased slot 65536 during cleanup. With the cherry-picked order, both tests in descriptor::raw_view_tests passed. Asset policy passed. No game files were used.

To repeat, run cargo test --locked -p victory-gpu --lib retiring_slot_is_unavailable_until_its_alias_is_cleared -- --nocapture. The test prints a completion marker after both lease assertions or an explicit skip if it cannot create a host view heap.

AI-assisted.

@r4tedx

r4tedx commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Taken, thank you: it is on the branch as fb8ea43, cherry-picked with your authorship, and upstream Marvisak#704's head and description now carry it.

What I ran on an RTX 5070 (native Windows, so it complements your Wine run):

  • retiring_slot_is_unavailable_until_its_alias_is_cleared passes at fb8ea43.
  • With the release order of 30a93f9 restored locally it fails as you describe: slot reusable before cleanup, left Some(Some(65536)), right Some(None). So the test does catch the bug.
  • Both tests in descriptor::raw_view_tests pass, and cargo test -p victory-shader passes (73).

The seam it adds (release_with taking the cleanup as a closure) is small and behaviour-neutral, which is the right price for a deterministic test of an ordering bug.

One note for whoever merges this branch into a tree with Marvisak#483's guard slot: the test takes the dynamic pool's size as alias_base() - count(), which holds on this branch (title, dynamic, pool) and will be one too many once a guard slot sits between the dynamic slots and the pool.

Since this went in by cherry-pick GitHub will not mark the PR merged; it can be closed. The title was not used in these tests. AI-assisted.

@MichaelSmithAI

Copy link
Copy Markdown
Author

Closing after the cherry-pick. Thanks for checking both release orders on native Windows. I also tried your guard-slot note on the combined Marvisak#483/Marvisak#493/Marvisak#704 tree. Using the guard as the exclusive end of the dynamic pool for both cleanup and the capacity assertion, both raw-view tests passed on the RTX 4090 under Wine. The integration is available at MichaelSmithAI@b969af9 for anyone combining those branches.

r4tedx pushed a commit that referenced this pull request Nov 25, 2026
A package copied without the DLLs that ship beside the executable leaves
every import from them unbound, and the title stops at its first call into
one: Grand Theft Auto VI 1.0.2.1 at +0x2237178 during System Init (Marvisak#930,
Marvisak#1553, #8), with nothing saying why.

After mapping the title DLLs, name the main image's static imports that
must come from the title's folder (neither the host nor our runtime serves
them) but were not mapped from it. Print them; when executing with the
default trap policy, stop before running title code. With
`--unimplemented zero` the title still runs (stubs were asked for).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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