Repository navigation
refactor(scene): one readback for the compositor's small GPU reads - #211
Conversation
Quest-Claim: bbc26dae2b778c4b
The dark-capture probe and the keep-clear look each kept their own storage and mapped buffers, rate cap, map in flight, and stale-read discard. Both now share readback::Readback and keep only their pipeline and what they make of the tiles. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
ℹ️ No correctness issues. One small nit inline.
Approach: sound. It does the one-helper extraction the maintainer settled on #194. The plumbing both readers duplicated moves into Readback<T>, and each reader keeps only its pipeline and what it makes of the tiles. The generic T carries the per-read metadata without forcing a trait on either side.
Reviewed changes I read the whole diff and both readers in full against the base to check that the extraction preserves behavior.
- New
readback::Readback<T>: owns the storage and mapped buffers, theduerate cap,submit/map_async, andfinish.discarddrops a read that has gone stale.restartdoes the same and also clearslast. I checked each against the code it replaces and they match. dark::Probe:forgetstill marks the read in flight stale without resettinglast. Thestepgate (changed && due) is the same as the oldreading.is_none() && changed && due.judgenow runs on the copiedVecflattened back to bytes, which covers the sameCOUNT * 4bytes as before. The only behavior change is the one the PR lists: a failed map on a stale read no longer warns.place::Look:restart,due, therecent/GAPcheck (now viaReadback::last()), and the per-read tilecountare all unchanged.place::INTERVALstays as a public alias and is only used insideplace.rs.- Quest file removed:
quest/m1/readback.mdis deleted, as the convention for a finished quest requires.
claude-opus-5-5 | 𝕏
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 51 minutes. View limit details
No actionable comments were generated in the recent review. WalkthroughThe change adds a shared GPU tile-readback abstraction with interval scheduling, asynchronous mapping, stale-read handling, and completion results. The dark probe and item-picture look now use this abstraction instead of maintaining separate readback buffers and state. Their storage binding sizes and tests were updated. Documentation and a test now refer to the shared interval. Merge Risk:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found. The earlier nit is fixed and nothing else changed.
Reviewed changes Since the review of 8bb0bba, there is one comment-only commit and a merge of main.
- Rewrapped the
Probe::stepdoc comment (3cc8a87): wrapped at about 78 columns, as the earlier nit suggested. The text is the same. - Merged
main(9264387): brings in5ae83b0. It does not change the PR's net diff, and nothing new onmainuses the removeddark::INTERVALor theLookfields that moved intoReadback.
claude-opus-5-5 | 𝕏

The dark-capture probe (
dark.rs) and the keep-clear look (place.rs) landed separately with the same GPU readback plumbing. They now share one helper,rs/moq-scene/src/readback.rs, and each keeps only its pipeline, bindings, and what it makes of the tiles.Changes
readback::Readback<T>owns what both had: the storage and mapped buffers sized to the reader's largest grid, the rate cap (due, at most everyreadback::INTERVAL= 250 ms, as both had), the copy after the compute pass, the submit, themap_asyncin flight, and dropping a read whose picture stopped mattering (discard, orrestart, which also makes the next read due at once).Tcarries what a read is of (()for the probe, the picture's size and whether it was compared for the look).dark::Probekeeps the capture copy, the good picture, andjudge;place::Lookkeeps the ping-ponging pictures and theGAPcheck, readingReadback::last().dark::INTERVALis gone (the module is private); its note on which pictures get read moved ontoProbe::step.place::INTERVALstays as an alias ofreadback::INTERVAL.This is behavior-preserving: the same dispatches, buffer sizes, copies, rate, and discard rules run each frame, so it needs no user-facing pick.
Validation
just ci: passed (lints and 460 tests).just render-sw's moq-scene filter plusplace::): 67/67 passed, includingdark::tests::*,compositor::tests::a_camera_keeping_clear_glides_off_what_movesanda_moment_of_dark_draws_the_last_good_picture. Only test edit:probe.reading.is_some()readsprobe.readback.busy().Public API and wire
None.
place::INTERVALkeeps its value and type; everything else touched is crate-private.Decisions
Taken while the maintainer was away; each is easy to undo in review:
readback::INTERVALfor both readers, rather thanReadback::newtaking an interval. Recommended: both read at 250 ms, and a parameter for a difference nobody needs is weight.moq-scene readback, instead ofmoq-scene dark tiles/moq-scene place tiles. Recommended: keepsnewat three arguments; the pipelines and bind groups keep their own labels, which is what a GPU capture shows by pass.finishcopies the tiles out (Vec<[u8; 4]>) rather than handing a borrowed mapped view, so no guard or callback crosses the API. Recommended: at most 9 KiB, 4 times a second.Follow-ups
None.
Models
Size: S
Implementer: Claude Code, claude-opus-5-5, medium effort (arm A)
(Written by Opus 5.5 with medium)
Review
Rewritten by
quest reviewafter each round.Head: 8bb0bba
Base: origin/main at c104a26
Risk: medium,
the base has no RISK.md to name what is always high or customer-facing, so every change is mediumClassified: medium by default
Reviewer: Codex, gpt-6.1-sol, medium effort
Session:
01a1f37e-c061-7261-8b95-97063d462e50, round 1Score: 9/10,
Source review found no actionable regressions, but runtime validation remains unverified because builds and tests were not run.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none
Reviewer: Codex, gpt-6.1-sol, low effort, shadow
Session:
01a1f37e-c060-74b3-87d1-b799d938997d, round 1Score: 9/10,
The refactor preserves scheduling, buffer handling, and stale-read behavior with no actionable regressions identified, subject to CI validation.Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0
Findings: none