test(gpu): tell the guard views are unmapped in drop_views so their bits do not outlive them #559

Manually merged
github merged 1 commit from github-bot/gh-559 into main 2026-12-05 17:30:05 +00:00 AGit
Owner

@⁠Kal0s-design on GitHub · 2026-12-05 07:06 UTC · original
Kal0s-design:fix/watch-flaky-test → main · +6 −2 · 1 files · 1 commits · merged 2026-12-05 17:26 UTC

The watch test the_rest_of_the_one_asking_has_a_number_of_its_own failed most of the time in the full suite and passed when run alone. It panicked on "watched" because writes() returned None for a freshly allocated write-watched range.

The cause is the drop_views test helper. Before it unmaps the two views of a section it tells the guard title_memory_remapped, which reopens the blocks but leaves them in VIEWS. After the unmap the blocks are still known as view memory, so when the next VirtualAlloc in another test lands on the same address, refused_as_view says yes and writes() never asks the kernel. Logging who set VIEWS showed that every caught failure was at a block last set by a_write_is_reported_at_every_checked_view, which ends with drop_views. Three other view tests failed now and then for the same reason.

The runtime already calls title_memory_unmapping before an unmap (xmem bind), which forgets the views. drop_views now does the same, so this is a test-only change.

On one NVIDIA desktop card with MSVC, the watch tests at four threads failed in 9 of 10 runs before the change and passed 10 of 10 after. The full suite had watch failures in 2 of 3 runs before and none in 4 runs after. Four indirect and pipeline tests fail on this machine with or without the change and are not related.

AI-assisted: yes

🤖 Generated with Claude Code

**@⁠Kal0s-design** on GitHub · 2026-12-05 07:06 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/559) `Kal0s-design:fix/watch-flaky-test` → `main` · +6 −2 · 1 files · 1 commits · merged 2026-12-05 17:26 UTC The watch test the_rest_of_the_one_asking_has_a_number_of_its_own failed most of the time in the full suite and passed when run alone. It panicked on "watched" because writes() returned None for a freshly allocated write-watched range. The cause is the drop_views test helper. Before it unmaps the two views of a section it tells the guard title_memory_remapped, which reopens the blocks but leaves them in VIEWS. After the unmap the blocks are still known as view memory, so when the next VirtualAlloc in another test lands on the same address, refused_as_view says yes and writes() never asks the kernel. Logging who set VIEWS showed that every caught failure was at a block last set by a_write_is_reported_at_every_checked_view, which ends with drop_views. Three other view tests failed now and then for the same reason. The runtime already calls title_memory_unmapping before an unmap (xmem bind), which forgets the views. drop_views now does the same, so this is a test-only change. On one NVIDIA desktop card with MSVC, the watch tests at four threads failed in 9 of 10 runs before the change and passed 10 of 10 after. The full suite had watch failures in 2 of 3 runs before and none in 4 runs after. Four indirect and pipeline tests fail on this machine with or without the change and are not related. AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
title_memory_remapped left the blocks in VIEWS, so the next test given
the same address was treated as view memory and the_rest_of_the_one_asking
_has_a_number_of_its_own failed most full runs. Use title_memory_unmapping
like the runtime does.

AI-assisted: yes

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 07:10:41 +00:00
github manually merged commit ffe832f93e into main 2026-12-05 17:30:03 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.