Repository navigation
Conversation
|
Strengthened the coverage in |
KelboLive
left a comment
There was a problem hiding this comment.
PR #2919 by @lambirou -- startup: persist and reuse translated PSO recipes
What works
- Solid foundational work establishing the 0x100 linear layout in gfx10_layout.h with careful derivation from AMD addrlib
- The linear_mode = 0 constant elegantly extends block_log2() to accept mode 0 without changing the tiled modes switch logic
- supports() check is correct: mode == linear_mode bypasses the block_log2 >= 12 requirement since linear has no tail
- Test infrastructure is excellent -- linear_order_control (expected failure with largest mip first), linear_addrlib (338K element addresses), and the unpadded negative control all add strong coverage
- Documentation accurately restates addrlib's linear mode algorithm in clear, testable terms
Issues
- supports() currently allows block-compressed formats (BC1-BC7) in linear mode via the fallthrough -- BC formats are block-based and don't have linear row semantics; consider gating them out explicitly like 1D does in #2929
- The check script in startup_address_console_check.py builds linear backing bytes from addrlib equations. This is correct but the linear path could break if the hardcoded equations drift from addrlib; a comment linking to the Mesa commit that derives these equations would help
Recommendations
- Good discipline in including the negative control (unpadded rows test) to verify the 256-byte pitch requirement
- Consider adding a TODO or assert in supports() that blocks linear mode for BC formats until explicitly validated against addrlib
Overall
A well-researched, well-tested implementation. The linear layout extension is cleanly separated from tiled modes. Minor concern about BC format handling in linear mode, but the existing refusal behavior is safe. Ready for merge.
KelboLive
left a comment
There was a problem hiding this comment.
PR #2919 by @lambirou -- startup: persist and reuse translated PSO recipes
What works
- Solid foundational work establishing the 0x100 linear layout in gfx10_layout.h with careful derivation from AMD addrlib
- The linear_mode = 0 constant elegantly extends block_log2() to accept mode 0 without changing the tiled modes switch logic
- supports() check is correct: mode == linear_mode bypasses the block_log2 >= 12 requirement since linear has no tail
- Test infrastructure is excellent -- linear_order_control (expected failure with largest mip first), linear_addrlib (338K element addresses), and the unpadded negative control all add strong coverage
- Documentation accurately restates addrlib's linear mode algorithm in clear, testable terms
Issues
- supports() currently allows block-compressed formats (BC1-BC7) in linear mode via the fallthrough -- BC formats are block-based and don't have linear row semantics; consider gating them out explicitly like 1D does in #2929
- The check script in startup_address_console_check.py builds linear backing bytes from addrlib equations. This is correct but the linear path could break if the hardcoded equations drift from addrlib; a comment linking to the Mesa commit that derives these equations would help
Recommendations
- Good discipline in including the negative control (unpadded rows test) to verify the 256-byte pitch requirement
- Consider adding a TODO or assert in supports() that blocks linear mode for BC formats until explicitly validated against addrlib
Overall
A well-researched, well-tested implementation. The linear layout extension is cleanly separated from tiled modes. Minor concern about BC format handling in linear mode, but the existing refusal behavior is safe. Ready for merge.
|
The two |
|
@R0Y00 the two |
|
Windows dev + release receipt on The two-process replay is the requested end-to-end control: first process writes the recipe, second process loads and precreates it, and the 32 RGBA bytes match. |
|
Could you share when you expect this PR to merge, and whether the record-limit behavior below should be addressed here? On head I also checked the 64-record boundary with the existing serializer and parser. A source-built file containing 64 valid records and a 65th with a different state key was 30,484 bytes, below the 65,536-byte file limit. The parser accepted 64, rejected the last with AI-assisted. |
R0Y00
left a comment
There was a problem hiding this comment.
Please address the writer/reader record boundary in this PR. On 711e7d95 plus main 1ec2c938 (tree 117604d5), I reproduced the effect through the ordinary draw entry point with a source-built VS/PS. At 63 valid seed records, the writer appended the live record as number 64 and the next process logged precreated 1. At 64 valid seed records, it appended number 65 at 30,810 bytes, well below 64 KiB. The next process logged recipe record limit reached, fell back and appended number 66. The pixels still matched on both WARP and RTX. This is a persistent cache miss after a successful write, so please align the append policy with the parser and cover the 64/65 boundary.
The implementation also opens the recipe file with FILE_SHARE_WRITE and seeks to the observed end. Two processes can both choose the same offset. Please make the count/size check and publication one writer transaction or document and enforce exclusive ownership, and keep a contending draw on the regular fallback path. I noted this from the code and did not fault-inject a concurrent interleaving.
Independent ctest --preset <dev|release> --no-tests=error -V -R '^(startup_pso_recipe|startup_stream_draw_(warp|hardware)|startup_compute_dispatch_native_(warp|hardware))$' gave four passes and one native-compute WARP 77 skip per preset. The normal two-process draw, manifest retry and exact red/green readbacks pass. Windows 11 26200.9974, SDK 10.0.26100, WARP 10.0.26100.9818 and RTX 4060 Laptop driver 32.0.16.1656. The standard stream test leaves the debug layer off; the boundary probe enabled it.
What changed
The translated draw path builds each desktop graphics PSO on its first draw, from state the shader cache does not store: the effective blend state after export write masks, depth-stencil state, rasterizer state, target formats, DSV format, sample mask and topology. A run therefore reconstructs that state and creates the PSO at the first draw.
This adds an opt-in persistent recipe cache:
X2W_PSO_RECIPE_DIR=<dir>, off by default.pipeline_forappends the exact state after a successfulCreateGraphicsPipelineState.load_translationreads the matching file and the firstpipeline_forreplays records whose target formats and DSV match the pass. A malformed record, an unknown version, a corrupt state key or a target-format mismatch is ignored and the unchanged creation path runs.This is state reconstruction, not a D3D12 pipeline library. A replayed record still calls
CreateGraphicsPipelineState; the driver may compile or find the PSO in its own cache. The change moves the state reconstruction and first-use creation earlier; it does not claim to eliminate driver compilation.Tests
startup_pso_recipepassed: 18 checks, 0 failed. It covers the serializer/parser round trip, two appended records, a corrupt state key, an unknown version, an oversized file, target-format and DSV mismatches, and the recreated blend/depth/rasterizer/sample/topology fields.startup_stream_draw_warpnow exercises the full path: the first translated stream draw writes a recipe, a second process with the same directory loads it, reports precreated records, and produces the same 32 RGBA bytes. The same test found and fixed a real serializer/parser gap: an unused depth-stencil block was written as a zero-filledD3D12_DEPTH_STENCIL_DESC, whose zero stencil ops the parser rejects. The serializer now writes a valid default for an unused block, and the parser normalizes it back for the state key.startup_stream_request_warpand the existing translated-draw fixtures still pass.d3d12_xs_shimandstartup_stream_consumerbuild.Limits
The replay still calls
CreateGraphicsPipelineState; it does not serialize a driver PSO or use a D3D12 pipeline library. The hardware draw was not rerun in this pass; WARP covers the two-process behavior. No game files or captures are included.Refs #870.
AI-assisted.