Repository navigation
hk: flush with memory scope for a G17P alias dependency recorded before any work - #124
DjDeveloperr wants to merge 8 commits into
Conversation
…re any work A dependency between compute or transfer work gets its memory-scope flush in hk_CmdPipelineBarrier2() only when the open compute stream already holds work (hk_cdm_visibility_flush_needed() is false at stats.cmds == 0). The first barrier of a command buffer has no open stream, so with a sparse or capture/replay resource alive its source writes, which are in an earlier command buffer, got no memory-scope flush before the first work after the barrier read them through another address. hk_CmdSetEvent2() had the same gate. Record the flush the way a host-read dependency already does: in a stream ordered after the source scope (hk_sync_get_cs_after()), and order the destination kinds after that stream with hk_sync_after_stream(). A reader in the same stream follows the record; a render waits for the stream. For an event, the flush goes ahead of the event write in the stream that carries it. hk_cdm_flush() still elides the record when the stream's tail already has memory scope. Devices without such a resource record what they did before; so does a barrier recorded into a stream that holds work. Not hardware-tested: the Neo is offline. Whether a memory-scope flush in a later stream writes back lines an earlier command dirtied is the point to test, with gpubench sparse.churn split so that the transfer barrier opens a second command buffer, in the same vkQueueSubmit and in a following one. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Name barriers after a compute stream closes as well as command-buffer openers. Also document the untested graphics-only source case, which keeps the ordinary strong flush. No behaviour changes.
…scope-stream-opener
Name barriers after a compute stream closes as well as command-buffer openers. Also document the untested graphics-only source case, which keeps the ordinary strong flush. No behaviour changes. (cherry picked from commit 1498a03)
An XFER source can name stream A while the open CDM stream B holds unrelated compute work. The memory-scope flush lands in B, but the source-stage dependency only orders graphics after A. After the alias flush, extend graphics destination requirements only when their CDM cut precedes the flush stream. Leave requirements that already include that stream and CDM destinations unchanged. The caller is gated on a live G17P alias resource and a compute or transfer source. Exercise the ordering helper and submission resolver in the existing CPU sync test, including flushes in the source stream and CDM-only destinations.
When the open compute stream holds work unrelated to the source, the memory-scope flush goes at its end, but a graphics destination is still ordered only after the source's stream, so it can start before the flush. Say so, so the comment does not imply that every recorded alias flush orders its graphics reader. Also rewrap the one line past 80 columns. Comment only. Raised in review of omacom#20. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tream-opener Keep this branch's alias-scope comment, which describes the flushes this branch adds in place of the gaps #128's comment names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The alias-scope comment names the stream-opener flush this branch adds but not the ordering hk_sync_after_alias_flush() adds when the open stream holds work unrelated to the source. Say that a graphics destination is ordered after that stream too. Comment only; every line now fits in 80 columns. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Hi, coming back to this one. Since it was opened, aurora-wip gained 8c27591 ("end compute streams with a memory-scope flush where memory may alias", merged with #266). That ends every compute stream with a memory-scope flush while |
Draft: not hardware-tested. The Neo is offline. This must not merge before the new cases have run on the affected hardware.
Follow-up to #98 and merged #123, from scottjones's and maralcbr's reviews of omacom#20. Mirror: omacom#23, based on the #20 branch. This branch merges aurora-wip at 8990cdb without rewriting its history.
There are two cases:
hk_CmdSetEvent2()also emits the flush before the event write.The hk_device.h comment now also names the untested graphics-only source case: attachment or shader writes through a sparse image followed by transfer or compute reads through a plain alias retain the ordinary post-graphics strong flush. Its behavior is unchanged. Resources created after recording and reached through indirect device addresses or update-after-bind descriptors remain outside the record-time resource gate.
The existing
hk_sync_priorCPU test now checks the production ordering helper and submit resolver for all three graphics destination classes, the source-stream case, and CDM-only destinations. It models stream dependencies, not GPU cache behavior.CI on omacom#23 at 6a13909, which carries this code as 78198e0, built it on x86_64 and aarch64 and ran the meson suites: 156/156 pass on both, including
hk_sync_priorwith the new cases (run). The negative control, the new cases failing without the fix, has not been run.Hardware tests prepared, not run: the scratch patch against gpubench db3fec6 in
work/gpubench-sparse-split.patchretainsGB_SPARSE_SPLIT=1(two command buffers, same submit) and=2(separate submits, no host wait), and adds=3(timestamp mid-command-buffer before the barrier) and=4(timestamp, unrelated compute, XFER-to-fragment barrier, render reading the plain pool alias). The changed C source compiles as an arm64 macOS object with-Wall -Wextra -Werror; the Linux target build is blocked by the same VM endpoint. No variant has run.Run variants 1-4 on the Neo against private builds of #20 and this draft, with the same seed and duration, through
/opt/neo-gpu/cts-1.0/gpurun.sh. The hardware question remains whether a memory-scope flush in a later stream writes back lines dirtied by an earlier stream; no new hardware result is claimed. The Zink A/B requested in #20 remains pending as well.Comment-only follow-up to merged #123: #128; carried into this branch with
cherry-pick -xand an opener-aware comment conflict resolution.