GPU: preserve staged texture hashes after rejected partial reads #395
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!395
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-395"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@VlREX on GitHub · 2026-11-25 00:21 UTC · original
VlREX:virex/texture-partial-refresh→main· +97 −11 · 2 files · 2 commits · openProblem
A rejected all-zero partial read updates the cached hash even though the staging data is unchanged. A subsequent fully mapped zero texture can therefore be skipped as if already staged.
Fix (updated after P2 review)
Preserve the staged hash when rejecting an all-zero partial read and reset the partial poll timestamp on the ordinary fully mapped path. Retain the original 30-frame partial read throttle regardless of guard reports: unguardable sparse blocks can be conservatively reported as written every query. Actual sparse writes may still wait for the next poll, as on upstream main. No change to the 8-frame guard policy, detiling or relay scheduling. Related to #89/#264; the link to skin artifacts is unverified.
Validation
Two Rust regression tests cover repeated sparse polling and rejected zero hashes. Executed JS model: 15,974,400 queries, zero disagreements with the expected periodic schedule. Native Rust and GPU A/B tests pending. No FPS gain claimed. No game data or new dependencies. AI-assisted (ChatGPT).
@VlREX on GitHub · 2026-11-25 00:47 UTC · original
Addressed the P2 finding in
9b7b9888d4. The guard-reported-write bypass is removed, restoring the 30-frame bound during continuous partial mapping. The rejected-zero hash fix and fully-mapped reset remain. Added a repeated-query Rust regression and checked 15,974,400 model queries against the periodic schedule (zero mismatches). Native Rust/GPU tests remain pending; actual sparse writes can still wait for the next poll. @codex review@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:49 UTC · original
Codex Review: Didn't find any major issues. Keep them coming!
Reviewed commit:
9b7b9888d4ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:38 UTC · original · edited 2026-11-25 00:49 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
9b7b988ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@sawetco on GitHub · 2026-11-25 01:00 UTC · original
I ran the native Windows tests on
9b7b988and checked what reaches a D3D12 texture on an RTX 5070 (621.24) and WARP. Both adapters reproduced the stale pixels with the basetexture.rsfrom31714deand returned the expected bytes with this PR.The fixture uses a synthetic 256×64 RGBA8 texture backed by a 64 KiB mapping. After each call to the production
Staging::refresh, it copies the staging buffer through a D3D12 texture to readback, waits for completion and checks all 65,536 bytes. Each table entry gives the byte value in the first and second 32 KiB. The two adapters agreed in every case.5151 / 5151 / 5151 / 5151 / 5151 / 5100 / 00A2, decommit second half again in the same frame51 / 51A2 / 00The last two rows exercise both the rejected-zero hash and the partial-poll reset. The four existing
texture::title_memory_testsalso passed with--profile diag --features diagnostics --test-threads=1on Windows 11 build 26300, rustc 1.100.0 MSVC. This verifies the synthetic remapping sequence. The effect on in-game character textures is still open.AI-assisted fixture, local testing and write-up (Codex).
@chatgpt-codex-connector[bot] on GitHub · 2026-11-25 00:42 UTC · original
On
crates/victory-gpu/src/texture.rsline 677 (outdated):When a sparse texture spans a 64-KiB view block with only some 4-KiB pages committed—the layout covered by
writes_in_partly_committed_view_blocks_are_reported—watch::protectcannot protect the whole block and leaves it outsideclean. Consequently,watch::guardconservatively reports that block on every query, andwritesassigns each report a fresh journal sequence even without writes or remaps. This makesguard_writtentrue after the first check, so the new bypass copies and hashes the entire unchanged sparse texture on every submission that samples it, rather than once per 30 frames. Distinguish these unguardable-block reports from confirmed writes, or retain bounded polling for them.Useful? React with 👍 / 👎.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.