Repository navigation
feat(gpu): hold incomplete BVH builds, back structured SRVs with raw views, and sync GPU-written texture aliases - #402
Open
gdemontalivet wants to merge 3 commits into
Conversation
Contributor
|
On an Apple M4 Pro with D3DMetal 4.0 beta 3, #402’s alias selector chose a linear Clearing the cached entry before a refresh and recording it only after emitting the copy commands gave Prepared and tested with Codex. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three rendering and GPU-stability issues affect Wave32 / D3DMetal hosts when acceleration-structure builders, structured-buffer descriptors, or aliased render targets run in world passes:
StructureByteStride > 0SRVs: Translated scalar (s_buffer_load_*) and unindexedMUBUFloads emitrawBufferLoadon a raw descriptor handle (victory_shader::emit), whereas the title binds many constant/parameter tables as structured buffer SRVs (StructureByteStride > 0). D3D12 leavesrawBufferLoadon a structured SRV undefined, reading garbage or hanging simulation loops; conversely, D3DMetal serves bothrawBufferLoadbyte offsets and structuredelement * stride + fieldbyte offsets from aDXGI_FORMAT_R32_TYPELESSD3D12_BUFFER_SRV_FLAG_RAWSRV at 4-byte (FirstElement) granularity.What changed
pipeline/builder.rs,pipeline/make.rs,pipeline.rs,draw.rs):builder::register/builder::held) and hold all builder dispatches back atomically until every registered builder pipeline has a valid host PSO and 64-lane waves run whole (VICTORY_BVH_BUILDER=1opts in on Wave32 hosts).VICTORY_SKIP_RT_RESOLVE=0overrides) so unbuilt acceleration structures are neither compiled nor traversed.descriptor/host.rs):StructureByteStride > 0buffer SRVs whose byte offset satisfies host alignment (4-byte dword alignment under Wine/D3DMetal; 16-byte alignment on native D3D12) intoDXGI_FORMAT_R32_TYPELESSD3D12_BUFFER_SRV_FLAG_RAWviews (VICTORY_RAW_STRUCTURED=0restores structured SRVs).resource.rs,texture.rs,pipeline/host.rs,draw.rs,ambient.rs,apps/victory/src/run.rs):texture::alias_copy, deduplicated per command list viaHostList::alias_source_changed) and suppress stale CPU staging uploads over GPU-authored textures.host_pipeline_for,VICTORY_TARGET_VARIANTS=0disables), coexisting cleanly with perf(gpu): cache render targets, bound pipelines, and unaligned CBV scratch per list #268'shost_targetsbind cache.VICTORY_AMBIENT=1, off by default) for runs where ray-traced indirect probes are held back.How it was tested
wave32=true), isolated test bottle:cargo test --workspace(native macOS): all passed (0failed).victory-gpu --libunder Wine + D3DMetal (--test-threads=1): all passed, including live D3DMetal GPU tests for:structured_buffer_srv_made_raw_reads_byte_and_element_offsets(StructureByteStride = 680,FirstElement = 1+680 B8 mod 16, verifying MUBUF raw byte load, SMEM scalar byte load, and MUBUF structured[2] + 12load in one dispatch),pipeline::builderatomic hold/release state machine and ray-resolve skip gating,resource::testscard-written cross-family texture alias copy (R32G32_UINT->BC1_UNORM),ambient::tests::the_passes_build(all 6 runtime HLSL compute PSOs built under Winevkd3d-shader+ D3DMetal).cargo xtask policy,git diff --check, andcargo clippy --workspace --all-targets --target x86_64-pc-windows-gnullvm -- -D warnings(with and without--features diagnostics): clean. All test inputs are synthetic.Live M5 Max Verification (Combined Build on CrossOver Preview + D3DMetal)
CrossOver Preview+ D3DMetal,wave32=true), the runtime reached and sustained the 3D world through+8, +24, +48, +90at1.5–1.8 FPS(549.7–672.1 ms/frameon1,021–1,258 draws/frame,1.275 FPSoverall across+8..+90) with02.48 sallocation stalls,7.2–9.0 ms/frameGUARDSlock hold time (down from4,887 ms/framebefore unlockingGUARDS),149–154 MB/framebuffer copy volume,0DirectStorage decompression or access-violation failures, and38/38over-32 KiB aligned mesh/pixel pairs linked with0host mesh refusals.