Mirror byte-written descriptors that cross a watch-page boundary #504

Open
github-bot wants to merge 1 commit from github-bot/gh-504 into main AGit
Owner

@⁠Tristan1019-user on GitHub · 2026-12-02 20:13 UTC · original
Tristan1019-user:codex/descriptor-page-straddlers → main · +82 −12 · 1 files · 1 commits · open

A descriptor can touch two dirty pages without lying wholly in either page job. Reproduced on current main in an isolated process: place a two-slot sampler heap eight bytes before a watch-page boundary, write a 16-byte sampler to slot zero, then sync. The host reports (false,false) for the two slots; expected (true,false). This is deterministic without concurrent heap synchronization and is distinct from #481's intermittent test ordering.

Form the jobs in whole heap records, deduplicate overlapping dirty intervals, and put a cross-page record in its own safe read. Keep current main's adaptive title-share growth and past-share reporting; the actual mirror stays within the host share. No change to guest descriptor sizes or shader caches.

Verified on an RTX 5080: cargo test --locked -p victory-gpu --lib dirty_sampler_across_two_watch_pages_is_mirrored -- --ignored --test-threads=1 failed on base 7dbcdcb1 and passed after this change. The neighboring slot stayed unset. Regular descriptor tests: 13 passed, including 16/32-byte strides, overlapping/out-of-order dirty spans, and the existing dynamic-slot boundary check. No claim about a specific visual artifact or FPS.

AI-assisted with Codex.

**@⁠Tristan1019-user** on GitHub · 2026-12-02 20:13 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/504) `Tristan1019-user:codex/descriptor-page-straddlers` → `main` · +82 −12 · 1 files · 1 commits · open A descriptor can touch two dirty pages without lying wholly in either page job. Reproduced on current main in an isolated process: place a two-slot sampler heap eight bytes before a watch-page boundary, write a 16-byte sampler to slot zero, then sync. The host reports `(false,false)` for the two slots; expected `(true,false)`. This is deterministic without concurrent heap synchronization and is distinct from #481's intermittent test ordering. Form the jobs in whole heap records, deduplicate overlapping dirty intervals, and put a cross-page record in its own safe read. Keep current main's adaptive title-share growth and past-share reporting; the actual mirror stays within the host share. No change to guest descriptor sizes or shader caches. Verified on an RTX 5080: `cargo test --locked -p victory-gpu --lib dirty_sampler_across_two_watch_pages_is_mirrored -- --ignored --test-threads=1` failed on base `7dbcdcb1` and passed after this change. The neighboring slot stayed unset. Regular descriptor tests: 13 passed, including 16/32-byte strides, overlapping/out-of-order dirty spans, and the existing dynamic-slot boundary check. No claim about a specific visual artifact or FPS. AI-assisted with Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-02 20:17:12 +00:00
Author
Owner

@⁠kwaadrat on GitHub · 2026-12-02 21:18 UTC · original · reviewed

Clean fix for page-straddling descriptors:

  • sync_record_parts aligns batches to changed_slots, uses next to assign each touched slot to at most one worker, and isolates any record crossing a watch::PAGE boundary ((left as u64 / step).max(1)) so a failed read on the trailing page cannot hide neighboring slots.
  • Adding continue when first_slot >= mirrored_count also fixes the fall-through that previously read records past mirrored_count.
**@⁠kwaadrat** on GitHub · 2026-12-02 21:18 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/504#pullrequestreview-6159201453) · **reviewed** Clean fix for page-straddling descriptors: - `sync_record_parts` aligns batches to `changed_slots`, uses `next` to assign each touched slot to at most one worker, and isolates any record crossing a `watch::PAGE` boundary (`(left as u64 / step).max(1)`) so a failed read on the trailing page cannot hide neighboring slots. - Adding `continue` when `first_slot >= mirrored_count` also fixes the fall-through that previously read `records` past `mirrored_count`.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/504/head:github-bot/gh-504'
git switch 'github-bot/gh-504'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-504'
git switch 'github-bot/gh-504'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-504'
git switch 'github-bot/gh-504'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-504'
git switch 'main'
git merge --squash 'github-bot/gh-504'
git switch 'main'
git merge --ff-only 'github-bot/gh-504'
git switch 'main'
git merge 'github-bot/gh-504'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.