Repository navigation
hk: say when the G17P alias-scope flush is recorded - #123
Merged
Merged
Conversation
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>
This was referenced Oct 31, 2026
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.
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 atstats.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; onlyhk_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