Repository navigation
Stop recording the unused Hi-Z pyramid (#269) - #389
Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
|
draw_into built six compute passes per frame for a pyramid no pass samples. That was the allocation jump past the #269 floor. The pyramid stays off until sample_hiz is set. Lavapipe samples are back in 100-120. The passes that still record keep the wgpu-core command lists. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
e01d196 to
8623310
Compare
There was a problem hiding this comment.
Adversarial review of 86233100 against 556a305c. The skip itself is sound. The contracts and the allocation gate around it are not.
What holds
HizPyramid::view has no caller. SsrPass is constructed only in ssr.rs tests. SsgiPass::execute binds the scene depth view, and ssgi_on stays false. Renderer::render records through draw_into, so both entry points hit record_hiz. HizPyramid::build only opens compute passes; there is no map, readback, SimRng, or wall clock. The nineteen replay cases do not hash this pyramid. Stopping the chain cannot change a world hash.
No new dependency, input path, credential, or socket. The R32Float pyramid (storage + COPY_SRC) is no longer created on the frame path. Scene depth is no longer copied into it. The early return does not drop a Result.
Moving the hiz stamp inside the early return matches invariant 22’s rule that a skipped pass does not take a timestamp slot. created_pass_validation and gpu_timestamp do not require an hiz label. Pass order after the skip is post (no depth), then particles (off unless an emitter is set). wgpu transitions depth on the next real use.
What does not
- The restored 100–120 gate sits on the samples this PR cites. Max sample 119, ceiling 120. The pre-pyramid samples were 110–113, so that old ceiling had margin this measurement does not. Spread was loosened from 4 to 6 while the published spread is 4. The lavapipe job runs this test with
WGPU_VALIDATION=1. - The trace update stops at the revision notice and invariant 21. §5 still says
draw_intobuilds the pyramid and marks the row Active. Invariant 22 still says Hi-Z records every frame. The rustdoc now sitting onclose_timing_gapstill says the first frame builds the pyramid and occlusion consults it. Decision 2 in the phase plan still says SSR, SSGI, and occlusion sample that pyramid. sample_hizis written only asfalse. The build that remains keys off dimensions, so the first real consumer will keep sampling the depth view captured at creation.
Determinism and the security surface of this diff are clean. The gate and the stale contracts should be fixed before merge.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
The gate sat on the measured high sample and allowed a spread of 6. Five lavapipe runs with validation on, and five with it off, each recorded [119, 116, 115, 116, 115, 115]. Spread inside a run is 4. The ceiling is 130, eleven above that sample and still under one extra pass. set_sample_hiz(true) drops any pyramid so the next draw_into copies that frame's depth view, including when the size is unchanged. The trace and phase-plan decision 2 describe that gate. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
There was a problem hiding this comment.
Adversarial review of f56b2fa4 against 556a305c. The skip and the rebind are sound. Four contract and CI leftovers from the previous pass are still open.
What holds
draw_into reaches record_hiz and returns before any mip pass unless hiz_depth_load and sample_hiz are both set. The default is false. HizPyramid::view has no caller. SsrPass::new is only called from ssr.rs tests. SsgiPass::execute binds the scene depth view. Renderer::render records through draw_into. HizPyramid::build only opens compute passes: no map, no readback, no SimRng, no wall clock. The nineteen replay cases do not hash this pyramid. Stopping the chain cannot change a world hash. No new dependency, input path, credential, or socket.
set_sample_hiz drops the pyramid on a real transition. copies_from uses wgpu 25 TextureView equality, which is TextureViewId (CoreTextureView.id through Arc's PartialEq). A clone keeps that id. A second create_view does not. record_hiz clones the caller view (or self.depth.view) and rebuilds when the id or the size differs, including after Renderer::resize replaces self.depth. The editor stores one depth_view until Viewport::resize, so a future enable does not rebuild every frame on that path. On lavapipe with WGPU_VALIDATION=1, hiz_pyramid_creation and enabling_sample_hiz_rebinds_to_the_current_depth_view passed.
The allocation ceiling is now 11 above the cited high sample (130 vs 119) and the spread check is back to 4, matching the ten cited runs. I did not rebuild with alloc-counter, so I did not re-sample frame_alloc.
What remains
- Invariant 21 still says there is no second pyramid.
nanite_gpu_culling.rsbuilds its own Hi-Z. §11 still says occlusion reads the previousHizPyramid. shaders/hiz_pyramid.wgslandshaders/hiz_pyramid_copy.wgslstill say SSR, SSGI, and occlusion sample this pyramid.last_verified_commitis still09d49dfeafter the bump to 1.44.stream_fallbackuses the new gate and is still absent fromrender-device-validation.yml, which runsframe_alloconly.
Determinism and the security surface of this diff are clean. The live trace sentences and the shader headers should agree before merge, or the next consumer will follow the stale one.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
Invariant 21 names Nanite's separate pyramid. Section 11 no longer says occlusion reads HizPyramid. The Hi-Z shader headers match the sample_hiz gate, and the trace stamp is f56b2fa. The lavapipe job runs stream_fallback. The decode runtime polls, so that test's fifo reader opens and the residency check finishes. The allocation samples stay [119, 116, 115, 116, 115, 115]. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
There was a problem hiding this comment.
Adversarial review of 596eed69 against 556a305c. The Hi-Z gate and the rebind are sound. Waking the texture-stream runtime is not, until the decode it starts uses the existing image cap and drop cannot join a blocked read.
What holds
draw_into returns from record_hiz before any mip pass unless hiz_depth_load and sample_hiz are both set. The default is false. HizPyramid::view still has no production caller. SsrPass::new is test-only. SsgiPass::execute binds scene depth. Renderer::render records through draw_into. build only opens compute passes: no map, no readback, no SimRng, no wall clock. The nineteen replay cases do not hash this pyramid. Stopping the chain cannot change a world hash.
set_sample_hiz drops the pyramid only on a real transition. wgpu 25 TextureView equality is CoreTextureView.id (TextureViewId, Copy). A clone keeps that id. A second create_view does not. record_hiz rebuilds when the id or the size differs, including after Renderer::resize replaces self.depth. The editor stores one depth_view until Viewport::resize.
No new dependency, credential, or socket. The pyramid shaders are comment-only. Invariant 21 names the Nanite pyramid and the unused _src_depth. §11 no longer says occlusion reads HizPyramid. The two shader headers match the gate. stream_fallback is on the lavapipe job.
What does not
DecodeRuntime now drives Handle::spawn inside block_on. That is what makes decode_texture run. That function still calls image::load_from_memory, which is Limits::default(): no edge cap and a 512 MiB non-strict alloc. #316 and trace v1.21 require decode_limited_image (4096 edge, 64 MiB). admit's 256 MB GPU budget runs only after the CPU buffer exists. tokio::fs::read of the caller path is also uncapped.
Drop joins that thread. Tokio then BlockingPool::shutdown(None), which waits until the spawn_blocking std::fs::read returns. stream_fallback drops the renderer before go_tx on any assert before the writer is released, and the writer is still blocked on that channel, so the fifo never opens. A red alloc gate becomes a hang until the lavapipe job's 45-minute timeout.
Determinism of the sim is unchanged while sample_hiz stays false and nothing calls request_streamed_albedo outside that test. Residency, once requested, is wall-clock and must stay out of the world hash.
last_verified_commit is f56b2fa4. The v1.45 sentences are in 596eed69. The notice says so. docs/current/PROJECT_STATUS.md still lists hiz 0.275 inside the 3.688 ms heavy-scene frame. That capture is 939a21bb. The default frame no longer records the pass.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
decode_texture used image::load_from_memory and an unbounded tokio::fs::read. It now rejects a file longer than 64 MiB before reading, reads at most that cap, and decodes with decode_limited_image. DecodeRuntime called BlockingPool::drop, which joins a stuck std::fs::read forever. shutdown_timeout waits 500 ms. stream_fallback releases its fifo writer on any exit, including a failing alloc assert. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
There was a problem hiding this comment.
Adversarial review of 2ce0da5d against 556a305c. The Hi-Z skip, the depth-view rebind, and the live decode cap hold. Two contract holes are still open, and the new drop test fails the Windows PR job.
What holds
draw_into returns from record_hiz before any mip pass unless hiz_depth_load and sample_hiz are both set. The default is false. HizPyramid::view has no production caller. SsrPass::new is only called from ssr.rs tests. SsgiPass binds scene depth. Renderer::render records through draw_into. HizPyramid::build only opens compute passes: no map, no readback, no SimRng, no wall clock. The nineteen replay cases do not hash this pyramid. Stopping the chain cannot change a world hash.
set_sample_hiz drops the pyramid only on a real transition. wgpu 25 TextureView equality is the inner id (impl_eq_ord_hash_proxy on DispatchTextureView, wgpu-core Id compares the raw id). A clone keeps that id. A second create_view does not. record_hiz rebuilds when the id or the size differs. The hiz timestamp is inside record_hiz, so a skipped pyramid does not take that slot.
decode_texture now rejects metadata.len() > MAX_IMAGE_ALLOC (64 MiB) before the read, then takes that many bytes. decode_bytes calls decode_limited_image. image 0.25.8 PngDecoder::with_limits passes that alloc cap into png::Decoder::new_with_limits and checks the 4096 edge. admit's 256 MB GPU budget still runs after the CPU buffer exists, and that buffer is now bounded. No new dependency, credential, or socket.
DecodeRuntime calls shutdown_timeout(500 ms). In tokio 1.48 that is BlockingPool::shutdown(Some(duration)): the wait returns when the blocking threads finish, or after 500 ms without joining them. BlockingPool::drop then returns immediately because shutdown is already set, so Drop no longer joins a stuck std::fs::read. ReleaseWriter is declared after the renderer, so an assert unwind sends on the fifo before DecodeRuntime joins. stream_fallback is on the lavapipe job.
What does not
drop_returns_while_a_fifo_read_is_blockedshells out tomkfifoand uses/tmp. It is a default lib test, notcfg(unix), and it is not in theci-prorci-pr-archivefilters. Windows PR partitions run this crate.mkfifois absent there, so the test fails the job. The cleanupopenfor write also blocks if the leaked reader is not already insideopen.last_verified_commitis596eed69. The v1.46 sentences describe2ce0da5d. At596eed69,decode_bytesis stillimage::load_from_memoryand runtime drop still joins the blocking pool with no timeout.- The file-map sentence says streaming reads stop at 64 MiB.
process_next_loadis public on the same type and still callsTexture::load_texture_async, whichtokio::fs::reads the whole path. Callers today are tests incoverage_booster_render.
Determinism of the sim is unchanged while sample_hiz stays false and residency stays off the world hash. The 500 ms bound is process shutdown, not a tick. docs/current/PROJECT_STATUS.md still lists hiz 0.275 inside the 3.688 ms heavy-scene frame from 939a21bb. That capture included the pass this PR no longer records on the default frame.
A producer that writes exactly 64 MiB and then stalls without closing still blocks: take returns at the cap, and the extra one-byte read waits for another byte or EOF. A regular file of that length returns EOF immediately. A fifo that never reaches the cap still blocks inside read_to_end, which is what stream_fallback measures.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
load_texture_async now uses read_capped_image. A regular file over 64 MiB is rejected from its length. A fifo that fills the cap is rejected without a further read. The fifo drop test is unix-only, lives in a temp directory, and opens its cleanup writer with O_NONBLOCK. The trace stamp is 2ce0da5. The 0.275 ms Hi-Z figure is that 1660 Ti capture; the default frame does not record it. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
There was a problem hiding this comment.
Adversarial review of 36757dad against 556a305c. The Hi-Z skip, the depth-view rebind, and the streaming read cap hold. That cap is not the image read the rest of the crate uses.
What holds
draw_into returns from record_hiz before any mip pass unless hiz_depth_load and sample_hiz are both set. The default is false. set_sample_hiz(true) is only called from tests/hiz_rebind.rs. HizPyramid::view has no production caller. HizPyramid::build only opens compute passes: no map, no readback, no SimRng, no wall clock. COPY_SRC is unused. The nineteen replay cases do not hash this pyramid. Stopping the chain cannot change a world hash.
set_sample_hiz drops the pyramid only on a real transition. copies_from is wgpu view identity, so a clone matches and a second create_view does not. record_hiz rebuilds when the id or the size differs. The hiz stamp sits inside record_hiz. Invariant 21 names the Nanite pyramid. §11 does not say occlusion reads HizPyramid. The shader headers match the gate. The alloc gate is min 100, max 130, spread 4, on [119, 116, 115, 116, 115, 115]. stream_fallback is on the lavapipe job. I did not re-run that job.
decode_texture and load_texture_async (process_next_load) both call read_capped_image. A regular file over 64 MiB is rejected from metadata before the read. take(meta.len()) keeps a stat/open swap inside a length that already passed len > cap. A non-regular stream of exactly 64 MiB is rejected without a further read. That is the safe side: the extra byte is what blocked, and accepting those bytes would decode a prefix. A regular file of exactly 64 MiB still loads. decode_bytes uses decode_limited_image (4096 edge, 64 MiB). DecodeRuntime uses shutdown_timeout (500 ms). No new dependency, credential, or socket. Tokio net is not added.
The drop test is #[cfg(unix)], uses a temp directory, and opens the cleanup writer with O_NONBLOCK (0x800 on Linux and Android, 0x4 on the other Unix targets). A missing reader is ENXIO instead of a blocked test thread. PROJECT_STATUS labels hiz 0.275 as the 939a21bb capture.
What does not
read_capped_imageis a second reader.open_limited_imagestillstd::fs::reads the whole file, and that is the path materials, IBL, impostors, smoke tests, the editor, and the asset CLI use.Texture::from_file_with_usagedoes the same on the public sync API. The decoder limit runs only after that allocation.AsyncReadExtneeds tokioio-util. This crate does not enable it. The graph gets it fromastraweave-security's workspace tokio.last_verified_commitnames2ce0da5dfor v1.47 behavior that is not in that commit. The v1.46 notice still says596eed69.
Determinism of the sim is unchanged. Residency stays off the world hash. The 500 ms bound is process shutdown, not a tick.
The Windows mkfifo hang is fixed. process_next_load now uses the cap. The stamp moved to 2ce0da5d and is already behind 36757dad.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
| pub(crate) async fn read_capped_image(path: &str) -> Result<Vec<u8>, String> { | ||
| use tokio::io::AsyncReadExt; | ||
|
|
||
| let cap = astraweave_asset::image_limits::MAX_IMAGE_ALLOC; | ||
| let meta = tokio::fs::metadata(path) | ||
| .await | ||
| .map_err(|err| format!("read failed: {err}"))?; | ||
| if meta.is_file() { | ||
| if meta.len() > cap { | ||
| return Err(format!("image is {} bytes, cap is {cap}", meta.len())); | ||
| } | ||
| let mut file = tokio::fs::File::open(path) | ||
| .await | ||
| .map_err(|err| format!("read failed: {err}"))?; | ||
| let mut bytes = Vec::new(); | ||
| (&mut file) | ||
| .take(meta.len()) | ||
| .read_to_end(&mut bytes) | ||
| .await | ||
| .map_err(|err| format!("read failed: {err}"))?; | ||
| return Ok(bytes); | ||
| } | ||
| let mut file = tokio::fs::File::open(path) | ||
| .await | ||
| .map_err(|err| format!("read failed: {err}"))?; | ||
| let mut bytes = Vec::new(); | ||
| (&mut file) | ||
| .take(cap) | ||
| .read_to_end(&mut bytes) | ||
| .await | ||
| .map_err(|err| format!("read failed: {err}"))?; | ||
| if bytes.len() as u64 == cap { | ||
| return Err(format!("image exceeds {cap} bytes")); | ||
| } | ||
| Ok(bytes) |
There was a problem hiding this comment.
read_capped_image is a second image-file reader. astraweave_asset::open_limited_image is the function trace v1.21 names, and it still does std::fs::read of the whole path before decode_limited_image. The 64 MiB decoder cap never runs if that read has already allocated the file.
Callers of that function include validate_texture_assets in this file, material_loader, ibl, impostor_bake, set_smoke_test_texture, the editor material inspector, and aw_asset_cli. Texture::from_file_with_usage (line 231) is the same unbounded std::fs::read on the public sync API of this type. It has no caller outside this module today.
The policy in this function holds. A regular file over the cap is rejected from metadata, and take(meta.len()) keeps a later swap inside a length that already passed len > cap. A fifo that delivers exactly the cap returns here without another read. Rejecting equality on a non-regular stream is the safe side: one more byte is the only way to tell EOF from "more", and that byte is what blocked. A regular file of exactly 64 MiB still loads, which matches MAX_IMAGE_ALLOC as an inclusive bound.
Put the bounded read in astraweave_asset::image_limits and call it from open_limited_image. This async function can stay the fifo-safe wrapper. A second cap means the next loader follows the helper whose read is not capped.
There was a problem hiding this comment.
Adversarial review of c666937f against 556a305c. The Hi-Z skip, the depth-view rebind, the streaming read cap, and the explicit io-util feature hold. Two contract sentences in this commit contradict the code, and the uncapped sync image reads are still open.
What holds
draw_into returns from record_hiz before any mip pass unless hiz_depth_load and sample_hiz are both set. The default is false. set_sample_hiz(true) is called from tests/hiz_rebind.rs only. HizPyramid::view has no production caller. HizPyramid::build opens compute passes: no map, no readback, no SimRng, no wall clock. COPY_SRC is unused. wgpu 25 TextureView equality is CoreTextureView.id, and wgpu-core Id compares the raw id, so a clone matches and a second create_view does not. record_hiz rebuilds when the id or the size differs. The hiz stamp sits inside record_hiz. The nineteen replay cases do not hash this pyramid. Stopping the chain cannot change a world hash.
tick_texture_streaming runs from draw_into. Residency is a GPU bind. It does not write ECS, nav, or physics. The 500 ms shutdown_timeout is Drop, not a tick.
decode_texture and Texture::load_texture_async (process_next_load) both call read_capped_image. A regular file over 64 MiB is rejected from metadata before the read. take(meta.len()) keeps a stat/open swap inside a length that already passed len > cap. A non-regular stream of exactly 64 MiB is rejected without a further read. At 2ce0da5d that path still did read of one extra byte after take(cap) filled, which is what blocked a fifo that stalled on the next byte. decode_bytes uses decode_limited_image. image 0.25.8 Limits::reserve enforces the 64 MiB alloc and check_dimensions enforces the 4096 edge. request_streamed_albedo still stores the caller path as the asset id. Its only caller is tests/stream_fallback.rs.
Tokio 1.48 has default = [] and io-util = ["bytes"]. The render crate's line now lists io-util and does not list net. The lockfile is unchanged because the workspace tokio line already enables io-util, so the unified graph already had bytes. No new crate, credential, or socket. The alloc gate is min 100, max 130, spread 4, on [119, 116, 115, 116, 115, 115]. I did not re-run lavapipe or cargo test.
What does not
open_limited_imagestillstd::fs::reads the whole file, and that is the path materials, IBL, impostors, the editor, and the asset CLI use.Texture::from_file_with_usageand the ktx2 fallback inset_smoke_test_texturedo the same. The decoder cap runs only after that allocation. #400 is open, names an owner and a plan, and has nodeferred-failurelabel. The field manual requires that label on a deferred failure. #400 tellsopen_limited_imageto call asyncread_capped_image. That helper is syncstd::fs. The bounded read belongs inastraweave_asset::image_limits. The earlier thread stays open.- The v1.48 metadata cell calls
596eed69the v1.45 parent. The v1.45 notice saysf56b2fa4is that parent and596eed69is the child. "Stamp updated on merge" has no writer in this diff. - The phase-plan status line calls the inventory a pre-build snapshot. The Occlusion / Hi-Z row still says the pyramid is for SSR and SSGI and that
draw_intodoes not build it, under a header that says the table was checked against this branch.
HizPyramid::new derives mip_count from (width.max(height) as f32).log2().ceil(). At 1×1 that is 0. record_hiz clamps with .max(1), so an enabled 1×1 frame requests mip_level_count 0. wgpu-core 25.0.2 rejects that (mips == 0 → InvalidMipLevelCount). The default flag is false, and hiz_rebind is 64×64, so the default frame does not hit it.
The Windows fifo hang, the shared streaming cap, and the missing io-util feature are fixed. The stamp no longer attributes the cap to 596eed69 or the shared reader to 2ce0da5d.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
| | **Document version** | 1.42 | | ||
| | **Last verified against commit** | `09d49dfe` (v1.41: flat sample on the shard 13 and 14 targets that hit 600s). Prior `0758171bf` (lifecycle RSS); prior `154d723aa` (v1.19, 2026-08-02: L.3.C-resolution — 4-cascade CSM + `FarCascadePolicy` + fit-derived bias cap; trace updated in the same commit as the code, so this names its parent); prior `d4c4479d4` (v1.12, 2026-07-25: T.2d.F tier retirement — see revision notice); prior `8232b150b` (v1.10, 2026-07-21: E3 terrain render-path additions verified first-hand — see revision notice); prior `7c29b8182` (v1.8 verification pass: §2.6 Water surface render path re-verified end-to-end against `water.rs` / `water.wgsl` / `renderer.rs` — every file:line citation confirmed, zero corrections, no markers needed; v1.7 added the subsection + cross-link to `docs/architecture/water.md`); prior: `67c9de7e1` (full trace); water rows W.2a + W.2b.2 + W.2c.2 weave-deformation + W.2c.3 weave producer (2026-06-22) + F.4.2 weave-impact accent machinery + F.4.3 live HDR-overlay composite & combined-frame measurement (2026-06-24) | | ||
| | **Document version** | 1.48 | | ||
| | **Last verified against commit** | `36757dad` (parent of this notice; verified at the PR head; stamp updated on merge). Prior `2ce0da5d` (v1.46 behavior: `decode_texture` caps the read and `shutdown_timeout` is 500 ms; the extra byte past a full fifo is still there). Prior `596eed69` (v1.45 parent: Hi-Z contracts, lavapipe `stream_fallback`, decode runtime polls). Prior `f56b2fa4` (v1.45: the forward `HizPyramid` is gated on `sample_hiz`; `NaniteCullingPipeline` keeps a separate pyramid). Prior `09d49dfe` (v1.41: flat sample on the shard 13 and 14 targets that hit 600s). Prior `0758171bf` (lifecycle RSS); prior `154d723aa` (v1.19, 2026-08-02: L.3.C-resolution — 4-cascade CSM + `FarCascadePolicy` + fit-derived bias cap; trace updated in the same commit as the code, so this names its parent); prior `d4c4479d4` (v1.12, 2026-07-25: T.2d.F tier retirement — see revision notice); prior `8232b150b` (v1.10, 2026-07-21: E3 terrain render-path additions verified first-hand — see revision notice); prior `7c29b8182` (v1.8 verification pass: §2.6 Water surface render path re-verified end-to-end against `water.rs` / `water.wgsl` / `renderer.rs` — every file:line citation confirmed, zero corrections, no markers needed; v1.7 added the subsection + cross-link to `docs/architecture/water.md`); prior: `67c9de7e1` (full trace); water rows W.2a + W.2b.2 + W.2c.2 weave-deformation + W.2c.3 weave producer (2026-06-22) + F.4.2 weave-impact accent machinery + F.4.3 live HDR-overlay composite & combined-frame measurement (2026-06-24) | |
There was a problem hiding this comment.
This cell calls 596eed69 the "v1.45 parent" and then calls f56b2fa4 v1.45 as well. The v1.45 notice below says the stamp names f56b2fa4, and that the Hi-Z contract edits, the lavapipe stream_fallback job, and the decode-runtime poll landed in its child 596eed69. A reader of the metadata row and a reader of the notice get two parents for one version.
The 2ce0da5d clause matches that commit: after take(cap) fills, the code reads one more byte, and a fifo that stalls there blocks. Head rejects len == cap on a non-regular stream and does not read that byte. Keep 2ce0da5d as the extra-byte commit. Stop calling 596eed69 a parent.
"Stamp updated on merge" has no writer in this diff. A merge leaves last_verified_commit as 36757dad, which is already what the parent convention requires. A squash drops 36757dad off main, and the merge does not rewrite this field. Name the parent and drop the promise.
| # Rendering architecture phase — plan | ||
|
|
||
| Status: **steps 1–7 are on this branch**. Step 8 (GTX 1660 Ti capture) is not in this series. The inventory table below is the pre-build snapshot. Decision 2 was overridden: one fixed `HizPyramid`, not a second occlusion pyramid. | ||
| Status: **steps 1–7 are on this branch**. Step 8 (GTX 1660 Ti capture) is not in this series. The inventory table below is the pre-build snapshot. Decision 2 was overridden: one fixed `HizPyramid`, not a second occlusion pyramid. `draw_into` builds that pyramid only when `sample_hiz` is set. Occlusion, SSR, and SSGI do not sample it. |
There was a problem hiding this comment.
This line calls the inventory a pre-build snapshot and then states the branch gate. The Occlusion / Hi-Z row in that inventory still says hiz_pyramid.rs builds a min-depth chain for SSR and SSGI, and that neither pyramid is built from draw_into. The section header says the table was checked against this branch.
"What landed" item 5 and Decision 2 say draw_into builds the pyramid only when sample_hiz is set, and that occlusion, SSR, and SSGI do not sample it. Point the inventory row at item 5, or say in the table header that the row is the pre-build snapshot. The header and the row currently describe the frame this PR removed.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour 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. |
There was a problem hiding this comment.
Adversarial review of c666937f against 556a305c. The Hi-Z skip, the depth-view rebind, the streaming read cap, and the explicit io-util feature hold. Three earlier threads are still open on this tree, and a 1×1 enable faults.
What holds
draw_into returns from record_hiz before any mip pass unless hiz_depth_load and sample_hiz are both set. The default is false. set_sample_hiz(true) is called from tests/hiz_rebind.rs only. HizPyramid::view has no production caller. HizPyramid::build opens compute passes: no map, no readback, no SimRng, no wall clock. Renderer::resize replaces self.depth and returns on a zero extent, so the next enabled frame sees a new view id and rebuilds. wgpu 25 TextureView equality is the view id, which hiz_rebind distinguishes: a clone matches, a second create_view does not. The hiz stamp sits inside record_hiz. The nineteen replay cases do not hash this pyramid.
tick_texture_streaming runs from draw_into and writes GPU binds. It does not write ECS, nav, or physics. DecodeRuntime drop drops the oneshot, which wakes block_on, then shutdown_timeout(500 ms) on the worker. That bound is Drop, not a tick. Determinism replay and the Aravath replay hash are green on ubuntu, windows, and macOS at this SHA.
decode_texture and Texture::load_texture_async call read_capped_image. A regular file over 64 MiB is rejected from metadata before the read. take(meta.len()) keeps a later size change inside a length that already passed len > cap. A non-regular stream of exactly 64 MiB is rejected with no further read. decode_bytes uses decode_limited_image (4096 edge, 64 MiB alloc). The unix fifo tests are cfg(unix). Lavapipe with WGPU_VALIDATION=1 recorded frame_alloc [119, 116, 115, 116, 115, 115] and stream_fallback [119, 116, 115, 116]. Both sit inside min 100, max 130, spread 4.
Tokio on this crate is fs, io-util, rt, rt-multi-thread, sync. net is absent. The lockfile is unchanged. Cargo deny and cargo audit are green on this SHA. No new crate, credential, or socket. request_streamed_albedo still stores the caller path and reads it; the only caller is tests/stream_fallback.rs. That read is now bounded.
What remains
The three open threads match the tree at this commit. #400 now carries deferred-failure, an owner, and a plan for a sync bounded read in astraweave_asset::image_limits. This commit does not call that helper.
open_limited_imagestillstd::fs::reads the whole file.Texture::from_file_with_usagedoes the same. The decoder cap runs after that allocation. Materials, IBL, impostors, the editor, and the asset CLI use the uncapped path.- The v1.48 metadata cell still calls
596eed69the "v1.45 parent". The v1.45 notice saysf56b2fa4is that parent and596eed69is the child. "Stamp updated on merge" has no writer in this diff. A merge leaveslast_verified_commitat36757dad. - The phase-plan header says the inventory was checked against this branch. The Occlusion / Hi-Z row still says the pyramid is for SSR and SSGI and that neither pyramid is built from
draw_into. Item 5 and Decision 2 saydraw_intobuilds it only whensample_hizis set, and that those passes do not sample it.
HizPyramid::new derives mip_count with (width.max(height) as f32).log2().ceil(). At 1×1 that is 0. record_hiz clamps the extent with .max(1), and Renderer::resize accepts 1, so an enabled 1×1 frame requests mip_level_count 0. wgpu-core 25.0.2 rejects that (InvalidMipLevelCount). The default flag is false, and the lavapipe gates are 64×64, so the default frame does not hit it. The phase plan tells the next consumer to call set_sample_hiz(true) with no size guard. .max(1) on the mip count keeps the existing power-of-two result (1024 stays 10) and makes 1×1 a single copy pass.
The Windows fifo hang, the shared streaming cap, and the missing io-util feature are fixed. The stamp no longer attributes the cap to 596eed69 or the shared reader to 2ce0da5d.
Sent by Cursor Automation: ASTRA PR AUDIT AGENT
| // and 0.275 ms on the 1660 Ti heavy scene. | ||
| return; | ||
| } | ||
| let width = self.config.width.max(1); |
There was a problem hiding this comment.
width.max(1) and height.max(1) turn a zero extent into 1×1, and Renderer::resize already accepts 1. HizPyramid::new then does (width.max(height) as f32).log2().ceil() as u32. log2(1) is 0, so this frame requests mip_level_count 0.
wgpu-core 25.0.2 rejects a zero mip count (InvalidMipLevelCount). If creation returned, the copy bind group indexes mip_views[0] on an empty range. hiz_rebind is 64×64 and sample_hiz defaults false, so the lavapipe gates do not reach it.
The phase plan's follow-up is to call set_sample_hiz(true) when a pass starts sampling. That call on a 1×1 target faults. Clamp the mip count with .max(1) in HizPyramid::new. ceil(log2(1024)) stays 10, which hiz_mip_count_power_of_two already asserts, and 1×1 becomes one copy pass. #400 lists this next to the uncapped sync reads; the fault is on the enable path this PR adds.
draw_into records the pyramid only when hiz_depth_load and sample_hiz are both set. The name gate includes echoes.toml. #269 was cross-referenced by #389. The close was not attributed. compile_legacy drop sites are the empty returns, not cell_origin. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>
* docs: record the weave origin island on main outside ±2048 cells and does not saturate, and the weaving replay case still hashes NullField. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> * docs: record #394, #396, and #397 on the status pages #397 closed #260. The mod host rejects an out-of-island origin before the cast is stored. #394 keeps the retired title out of player-facing assets. The 0.323 ms figure is the cloud_shadow pass. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> * docs: correct the weave-origin citations the audit flagged A dropped wind returns from wind_direction before legacy_geometry_kept. A failed mod run drops only that agent's casts. SEC-MOD-2 is the range check already on main. The status pins name which sentences were checked at 49d289e. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> * docs: name both Hi-Z flags and the echoes scan draw_into records the pyramid only when hiz_depth_load and sample_hiz are both set. The name gate includes echoes.toml. #269 was cross-referenced by #389. The close was not attributed. compile_legacy drop sites are the empty returns, not cell_origin. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> * docs: a failed weave run drops only that call The tick walks scripts, then agents. An earlier Ok for the same agent stays applied. The new test locks that. The scripting trace now says nineteen replay cases, and sample_hiz is the flag that defaults off. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> * docs: a later weave success still lands after a failed script The test queues a cast, a failing origin, then another cast, and compares two runs. #217 landed when the required replay set was fifteen. The required set is now nineteen. Revision 1.6 is withdrawn. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> * docs: stamp the scripting trace at the commit that has the test last_verified_commit is 79122e7. That commit contains the three-source weave test and invariant 9. 49d289e is trace 1.5 and does not. Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: Andrew Brown <lazyxeon@users.noreply.github.com>


Description
Rebased onto
mainat556a305c. No lockfile, audit, or deny edits.draw_intodoes not build the Hi-Z pyramid unlesssample_hizis set. The 1660 Ti capture recordedhizat 0.275 ms. The default frame no longer records that pass.astraweave-renderenables tokioio-utilon its own dependency line.read_capped_imageis shared bydecode_textureandTexture::load_texture_async. A regular file over 64 MiB is rejected from its length. A fifo that fills the cap is rejected without a further read.The trace stamp names the parent
36757dad. Verified at the PR head. The stamp is updated on merge. v1.46 no longer treats596eed69as the commit that contains the cap.Uncapped
std::fs::readinopen_limited_imageandTexture::from_file_with_usagestays out of this PR. Follow-up is #400, next after #389 and before #372.Type of change
Security Considerations
Checklist