Repository navigation
Conversation
flat_store_* and global_store_* decoded and translated, but a store whose
segment is not scratch was refused when the SPIR-V was emitted ("writable
FLAT/GLOBAL addresses require GPU ownership tracking").
Such a store now goes through the BDA page table like a store through a
GPU-selected V#: the write lookup needs Write permission, which only a
writable registered range imported in place has, and the written page is
noted for the host to mark GPU-written. Byte and short stores, and dword
stores to an address that is not dword aligned, are stored byte by byte.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for this, and sorry it sat without a comment for a while. I reviewed it as part of #491, which carries this commit unchanged: flat and global stores go through the BDA write path, and read-only, unmapped and misaligned addresses are reported instead of written. Since it adds a new guest write path, I'll run it (with #491 on top) through my PPSA21564 test runs and merge it first if they pass. The one red CI job on this head is Linux |
|
Thanks for this one. #491 (adriadam10) carries your commit rebased onto current main as be866e4, the same patch with your authorship, and #491, #495 and #506 build on it. Merging this branch at 673401b and then #491 conflicts in I gated be866e4 on PPSA21564 together with #491, #495 and #506: no visual or FPS change, and the full ctest passes. If anything in your branch isn't in be866e4, let me know and we can follow up. |
Conflicts resolved: - libSceAudioPropagation/Export.cpp: upstream's boykopovar#482 + boykopovar#489 version taken; it is the same no-propagation model as astrobot's stand-in, with SourceRender and the handle-only UnregisterMaterial already in it. - State.cpp (boykopovar#453): astrobot's resident depth model kept; it already skips the tests of an absent plane (boykopovar#453's test is on astrobot since e087a4f). - Graphics.cpp, State.hpp, ShaderResources.cpp: astrobot's DepthTarget model kept (exportIndex, no DepthSurface.hpp), upstream's ThreadOwned include added. - BdaResources.cpp: astrobot's form with boykopovar#390's message. - VulkanDevice.cpp, Context.hpp, PacketExecution.cpp: both sides kept (calibrated timestamps, host query reset, GDS, memory budget; pipeline stats). - Spirv: astrobot's split-wave rules first, then boykopovar#608's wave-mask ballot and boykopovar#587's host subgroup lane; astrobot's function LDS sizing and boykopovar#573's LDS lock both kept; conditionalDepth kept in the atomic update loops; upstream's buffer atomics (boykopovar#321 boykopovar#332 boykopovar#594) and 64-bit LDS atomics taken. - TechnicalDebt.md: both sides, duplicate lines dropped. Build fixes folded in: the upstream boykopovar#453 test block duplicated next to astrobot's adapted copy removed; a lost closing brace after the host query reset block restored; lookupLog() is a function since boykopovar#590; the duplicate MUTEX_TYPE_ADAPTIVE constant (astrobot's 93b2d0e equals boykopovar#156) removed; the ops boykopovar#596 drops removed from the masked-select list and the BDA test message updated (the gate-batch-2 integ commits 559e4fab6 and 2ec968fb5).
|
@DotDebian heads-up on I'm trimming my own ones the same way: #677 (fewer BDA ops), #688 and #689 (split by cost, opcodes and HW rows kept). Since this test came in through my PR, I'm happy to do the same for |
What
flat_store_*andglobal_store_*(byte, short, dword, dwordx2/x3/x4) decode and translate onmain, but a store whose segment is not scratch never reaches the GPU:AnalyzeProgramRequirementsthrowswritable FLAT/GLOBAL addresses require GPU ownership tracking, andStoreAddresshas no emitter for a guest address.Since 21cb567 (stores through GPU-selected V#s) the BDA page table has that tracking: a write lookup that needs
Writepermission, and a set of written pages the host marks GPU-written once the work completed. This PR sends FLAT and GLOBAL stores through it.StoreAddressemits aFlat/Globalstore with the newEmitBdaStore, on the address the loads already form (GuestAddress: 64-bit vector address, or scalar base + vector offset, plus the immediate), under the instruction's EXEC bit.get_bda_write_pointerlookup and one store, the codeEmitBdaWritealready had (now shared asEmitBdaStoreAt). Byte and short stores, and a dword store to an unaligned address, store each byte through its own lookup, so a store may straddle two ranges like the byte path of the loads.EmitBdaWriteitself (V# stores) is unchanged: an unaligned V# store still faults.ResourceTrackersetsbdaWritesfor an address store, which is what defines the write lookup andnote_bda_write.The rules of the write path are unchanged and apply as they are: a store lands only in a writable registered range the host imported in place; into a read-only range, a mirror or a copy it is refused and reported as a BDA fault (
Permission).Not part of this PR: the FLAT/GLOBAL atomics and
global_store_dword_addtid(stillFLAT opcode is not supported). They need this store path first.Tested
Windows 11, MinGW-w64 GCC 15.2.0, NVIDIA GeForce RTX 5080 (32-wide subgroups),
ctestfrom PowerShell: 109/109 pass.New test
agc_driver_flat_store(tests/execution/FlatStore.cpp): a 64-thread compute program runs on a real Vulkan device against a 64 KiB registered guest range, as wave32 and as wave64, and the whole first 8 KiB of the range are compared with a CPU reference. It coversglobal_store_dwordwith a scalar base and a vector offset,flat_store_dwordandglobal_store_dwordwith a 64-bit vector address, negative immediates,global_store_byte,global_store_short, a dword store to an unaligned address,dwordx2/x3/x4, aglobal_load_dwordof a dword stored by the same thread, and a store underv_cmpx_gt_u32(threads outside EXEC must not store). A second range registered read-only takes the same program and must stay unchanged.On
mainthe test fails withShaderRecompiler::Recompile: writable FLAT/GLOBAL addresses require GPU ownership tracking. With the EXEC gate removed from the new emitter it fails on the masked threads.Not tested: Linux (the test allocates with
std::aligned_allocthere, astests/Recorder.cppdoes, and has not been run on lavapipe or RADV), any title, stages other than compute, a host with 64-wide subgroups (wave64 ran as two lanes per invocation). The test only checks that the read-only range is unchanged; the fault itself is reported by the recorder on stderr (deferred write-back failed) and is not asserted.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code