Skip to content

hk: say when the G17P alias-scope flush is recorded - #123

Merged
RyanTheTide merged 1 commit into
aurora-wipfrom
fix/g17p-alias-scope-comment
Oct 31, 2026
Merged

RyanTheTide merged 1 commit into
aurora-wipfrom
fix/g17p-alias-scope-comment

Conversation

@DjDeveloperr

Copy link
Copy Markdown

Comment-only follow-up to #98, from scottjones's review of its mirror omacom#20 (his questions 1 and 3).

The comment on hk_cdm_alias_scope() said the memory-scope flush "also covers writes recorded in earlier command buffers". What the code does: hk_CmdPipelineBarrier2() records the flush into the open compute stream, and only when that stream already holds work (hk_cdm_visibility_flush_needed() returns false at stats.cmds == 0, hk_cmd_dispatch.c). A fresh command buffer has no open stream until its first work, so a barrier recorded before any work records no flush; only hk_sync_barrier() runs, which orders streams and writes nothing into any of them. At submit each stream is its own kernel command (hk_queue.c), so nothing joins it to the earlier command buffer's stream either. The comment now says that, and says that whether the hardware returns stale data in that case is untested: the Neo is offline, so the sparse.churn split Scott asked for has not run.

It also widens the "not covered" case: a descriptor set bound at recording and updated after it (descriptorBinding*UpdateAfterBind is advertised in hk_physical_device.c) reaches a resource created after recording the same way an indirect device address does.

No code change. A behaviour change for the start-of-command-buffer case follows in a separate draft PR stacked on this one.

🤖 Generated with Claude Code

The comment on hk_cdm_alias_scope() said the memory-scope flush also
covers writes recorded in earlier command buffers. It does when a later
barrier records the flush: hk_CmdPipelineBarrier2() records it into the
open compute stream, and only when that stream already holds work
(hk_cdm_visibility_flush_needed() returns false at stats.cmds == 0). A
barrier recorded before any work in a command buffer has no such stream
and records no flush. Whether the hardware returns stale data then is
untested; the comment now says so instead of claiming coverage.

The "not covered" case also includes a descriptor set updated after bind
to reach a resource created after recording
(descriptorBinding*UpdateAfterBind is advertised).

From the review of omacom#20.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants