GPU tests: the release-and-re-take case of FIND-14, ignored until it is fixed #3077

Closed
github-bot wants to merge 1 commit from github-bot/gh-3077 into main AGit
Owner

@⁠HoLa-Lee on GitHub · 2026-11-26 06:47 UTC · original
HoLa-Lee:tests/find14-release-case → main · +60 −0 · 1 files · 1 commits · closed without merging

GPU tests: the release-and-re-take case of FIND-14, ignored until it is fixed

A copy of a title buffer holds the address it was registered with and writes
back through it, and watch.rs documents that "memory freed and allocated again
while a tracker holds it is not seen". So a range the title releases - and takes
the same addresses for again - between a submission and its copy-back can have
that submission's shader bytes written into whatever holds them now.

This adds the deterministic test for it, ignored because it still fails on main:

left: 153   (0x99, what the shader wrote for a submission that is over)
right: 238  (0xEE, what the title's next use of the address held)

No game, no GPU work beyond registering the copy: register a page, take the
submission's snapshot, let a shader write one byte into the copy, unregister
and VirtualFree, take the same addresses again with VirtualAlloc filled with
0xEE, then run the copy-back. It observes only when the allocator hands the same
address back and says so when it does not.

Why it is worth having while it is red: #2612 fixes FIND-14 at the runtime's own
itle_memory_remapped, which is the right hook for the reported remaps - and
this case never reaches it, because a release and re-take is not a remap. It
fails on #2612's head (4f47bdc) exactly as it fails here, so it is the flag for
the other half: the addresses really go away in Memory's Drop (committed
resources and heaps) and in the upload block's Drop before VirtualFree.

Whoever fixes that flips this on by deleting the #[ignore]. Nothing else in the
tree changes: the test is self-contained and uses only APIs the other shadow tests
already use.

**@⁠HoLa-Lee** on GitHub · 2026-11-26 06:47 UTC · [original](https://github.com/Marvisak/VIctory/pull/3077) `HoLa-Lee:tests/find14-release-case` → `main` · +60 −0 · 1 files · 1 commits · closed without merging GPU tests: the release-and-re-take case of FIND-14, ignored until it is fixed A copy of a title buffer holds the address it was registered with and writes back through it, and watch.rs documents that "memory freed and allocated again while a tracker holds it is not seen". So a range the title releases - and takes the same addresses for again - between a submission and its copy-back can have that submission's shader bytes written into whatever holds them now. This adds the deterministic test for it, ignored because it still fails on main: left: 153 (0x99, what the shader wrote for a submission that is over) right: 238 (0xEE, what the title's next use of the address held) No game, no GPU work beyond registering the copy: register a page, take the submission's snapshot, let a shader write one byte into the copy, unregister and VirtualFree, take the same addresses again with VirtualAlloc filled with 0xEE, then run the copy-back. It observes only when the allocator hands the same address back and says so when it does not. Why it is worth having while it is red: #2612 fixes FIND-14 at the runtime's own itle_memory_remapped, which is the right hook for the reported remaps - and this case never reaches it, because a release and re-take is not a remap. It fails on #2612's head (4f47bdc) exactly as it fails here, so it is the flag for the other half: the addresses really go away in Memory's Drop (committed resources and heaps) and in the upload block's Drop before VirtualFree. Whoever fixes that flips this on by deleting the #[ignore]. Nothing else in the tree changes: the test is self-contained and uses only APIs the other shadow tests already use.
A copy of a title buffer holds the address it was registered with and writes
back through it, and watch.rs documents that "memory freed and allocated again
while a tracker holds it is not seen". So a range the title releases - and takes
the same addresses for again - between a submission and its copy-back can have
that submission's shader bytes written into whatever holds them now.

This adds the deterministic test for it, ignored because it still fails on main:

    left: 153   (0x99, what the shader wrote for a submission that is over)
    right: 238  (0xEE, what the title's next use of the address held)

No game, no GPU work beyond registering the copy: register a page, take the
submission's snapshot, let a shader write one byte into the copy, unregister
and VirtualFree, take the same addresses again with VirtualAlloc filled with
0xEE, then run the copy-back. It observes only when the allocator hands the same
address back and says so when it does not.

Why it is worth having while it is red: #2612 fixes FIND-14 at the runtime's own
	itle_memory_remapped, which is the right hook for the reported remaps - and
this case never reaches it, because a release and re-take is not a remap. It
fails on #2612's head (4f47bdc) exactly as it fails here, so it is the flag for
the other half: the addresses really go away in Memory's Drop (committed
resources and heaps) and in the upload block's Drop before VirtualFree.

Whoever fixes that flips this on by deleting the #[ignore]. Nothing else in the
tree changes: the test is self-contained and uses only APIs the other shadow tests
already use.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:54:57 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 08:22 UTC · original

Automated triage for the maintainers.

Needs work. The test adds a_pending_copy_back_does_not_write_into_memory_the_title_took_back to shadow.rs as #[ignore]. It sets up a title range that is unregistered and freed between a submission's snapshot and its copy_back. On main, Host::execute (host.rs) runs shadow.copy_back after the GPU work and before the submission's deferred writes and after work. So the title can only free the range in that window if it frees memory a submission it has not seen finish is still writing. The PR does not show that the title does this. What would help:

  • Evidence that the title releases and re-takes a range while a submission that writes it is still in flight (a trace from a run, or the runtime path that lets it happen).
  • Reference the issue number instead of the label "FIND-14", which does not exist in this repository.

An ignored test for a hazard that is not shown to happen adds little on its own. It would fit better next to the fix. CI: not run.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 08:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/3077#issuecomment-7186511784) <!-- victory-triage v1 head=0a794f0230b071fc6f2f5c9650f2f99b3d2099e1 verdict=needs-work at=2026-11-26T08:18:02Z --> Automated triage for the maintainers. Needs work. The test adds `a_pending_copy_back_does_not_write_into_memory_the_title_took_back` to `shadow.rs` as `#[ignore]`. It sets up a title range that is unregistered and freed *between* a submission's snapshot and its `copy_back`. On `main`, `Host::execute` (`host.rs`) runs `shadow.copy_back` after the GPU work and before the submission's deferred writes and `after` work. So the title can only free the range in that window if it frees memory a submission it has not seen finish is still writing. The PR does not show that the title does this. What would help: - Evidence that the title releases and re-takes a range while a submission that writes it is still in flight (a trace from a run, or the runtime path that lets it happen). - Reference the issue number instead of the label "FIND-14", which does not exist in this repository. An ignored test for a hazard that is not shown to happen adds little on its own. It would fit better next to the fix. CI: not run. --- _Generated by [Claude Code](https://claude.ai/code)_
github-bot closed this pull request 2026-11-26 12:19:27 +00:00
Author
Owner

@⁠HoLa-Lee on GitHub · 2026-11-26 12:16 UTC · original

Closing: the triage is right on the part that matters, and the right place for this test is next to the fix.

The evidence point stands. Host::execute runs shadow.copy_back after the GPU work and before the submission's deferred writes, so a title that frees a range in that window is freeing memory a submission it has not seen finish still writes. I have not shown that the title does that, and I do not have it: what I have is the runtime remapping memory (watch::title_memory_remapped is called from the title's own paths, which is why #2612 can hook it) and a synthetic free-and-re-take. Remapping is not freeing, so the gap the test exercises is a construction of the test, not an observed behaviour.

So: FIND-14 is a label in the coordination thread (#1633), not an issue - that is my mistake to have used it as if it were one - and an ignored test for a hazard nobody has seen happen does not pull its weight on its own. The test is offered in #2612, where the fix lives and where it fails on the head (0x99 in 0xEE at 4f47bdc); if the author of #2612 wants it, it lands there with a fix beside it, and if the free-side hook is ever added it can be a PR of its own with that fix.

For the record, and so the next person does not have to redo it: the reproduction is 60 lines in shadow.rs's test module, needs no game and no GPU work beyond registering a copy, and only observes when the allocator hands the same address back.

**@⁠HoLa-Lee** on GitHub · 2026-11-26 12:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/3077#issuecomment-7191786990) Closing: the triage is right on the part that matters, and the right place for this test is next to the fix. **The evidence point stands.** `Host::execute` runs `shadow.copy_back` after the GPU work and before the submission's deferred writes, so a title that frees a range in that window is freeing memory a submission it has not seen finish still writes. I have not shown that the title does that, and I do not have it: what I have is the runtime *remapping* memory (`watch::title_memory_remapped` is called from the title's own paths, which is why #2612 can hook it) and a synthetic free-and-re-take. Remapping is not freeing, so the gap the test exercises is a construction of the test, not an observed behaviour. **So:** `FIND-14` is a label in the coordination thread (#1633), not an issue - that is my mistake to have used it as if it were one - and an ignored test for a hazard nobody has seen happen does not pull its weight on its own. The test is offered in #2612, where the fix lives and where it fails on the head (`0x99` in `0xEE` at `4f47bdc`); if the author of #2612 wants it, it lands there with a fix beside it, and if the free-side hook is ever added it can be a PR of its own with that fix. For the record, and so the next person does not have to redo it: the reproduction is 60 lines in `shadow.rs`'s test module, needs no game and no GPU work beyond registering a copy, and only observes when the allocator hands the same address back.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3077
No description provided.