Skip to content

hk: resolve deferred occlusion availability from the end on G17P - #83

Merged
DjDeveloperr merged 1 commit into
aurora-wipfrom
fix/hk-oq-resolve-from-end-20261027
Oct 27, 2026
Merged

DjDeveloperr merged 1 commit into
aurora-wipfrom
fix/hk-oq-resolve-from-end-20261027

Conversation

@DjDeveloperr

Copy link
Copy Markdown

Deferred occlusion-availability streams were resolved in recording order. While an earlier stream was being judged, every later deferred stream was still in the list, waiting on its own later render. That counts as compute waiting on the render subqueue, so only the last deferred stream of a command buffer could ever ride on its render. Every earlier occlusion query paid a compute command for its availability. The branch that collects movable stores into a later stream could not be reached. The resolver tests from #82 showed this.

On G17P the resolver now runs from the end of the command buffer:

  • A later stream whose render carries its stores is dropped before earlier streams are judged. Each render whose queries nothing else waits on carries its own availability.
  • A stream that stays (kept, or movable) still counts as a waiter. A later query reset or barrier that waits on a stream still keeps that stream in place.
  • Movable stores collect into the latest movable stream when it waits on a render that completes after theirs.

Scope:

  • The other native AGX3 chips (G15S, G15C, G16G) keep recording order until it is measured on them. hk_resolve_oq_forward() is the previous loop, unchanged.
  • The AGX3c parts (M5) don't use render-carried availability, so this doesn't touch them.

Tests (host): hk_query_oq passes 48/48. The new checks cover:

  • every render of a G17P command buffer carrying its own store;
  • an earlier store kept behind a later stream that stays, or behind a later reset;
  • recording order on G16G.

hk_sync_prior and hk_query_reset also pass.

A18 Pro (Neo): integration/aurora module b3a06ac6, base = aurora-wip eebf55e, 0 GPU recoveries.

A/B on the occlusion_query cases plus every 4th query_pool case (4898 cases):

base this PR
CTS 4879 pass / 19 NS 4879 pass / 19 NS
render publications 12803 12803
compute publications 17662 17630

The CTS rarely records several deferred occlusion streams in one command buffer, so the count barely moves here. In a command buffer with many occlusion queries, each earlier query no longer costs a compute command.

On this PR:

  • Regression gate: pass.
  • Targeted CTS: 4687 pass / 681 NS / 0 fail.
  • Render CTS sample (renderpass, dynamic_rendering, draw, query_pool, multiview): 8409 cases, 6394 pass / 2015 NS / 0 fail.

Deferred occlusion-availability streams were resolved in recording
order. While an earlier stream was judged, every later deferred stream
was still in the list and waited on its own, later render, which counts
as compute waiting on the render subqueue: only the last deferred
stream of a command buffer could ever ride on its render, and every
earlier occlusion query paid a compute command for its availability.
The branch that collects movable stores into a later stream could not
be reached.

On G17P, resolve from the end instead. A later stream whose render
carries its stores is dropped before earlier streams are judged, so
each render whose queries nothing else waits on carries its own
availability. A stream that stays (kept, or movable) still counts as a
waiter, and a later query reset or barrier waiting on a stream still
keeps it in place. Movable stores collect into the latest movable
stream when it waits on a render that completes after theirs. The other
native AGX3 chips (G15S, G15C, G16G) keep recording order until it is
measured there; the AGX3c parts do not use render-carried availability.

The resolver tests now show every render of a G17P command buffer
carrying its own store, the earlier store kept behind a remaining later
stream or a later reset, and recording order on G16G.
@DjDeveloperr
DjDeveloperr merged commit f3639d3 into aurora-wip Oct 27, 2026
astaff pushed a commit to astaff/mesa that referenced this pull request Oct 28, 2026
aa733fc is the Mesa the J616s runs every day. Bring aurora-wip 2a5fd4a
into it: DJ's G17P refit and H-PLOC fixes (aurora-silicon#79, aurora-silicon#81), the deferred
occlusion resolver (aurora-silicon#82, aurora-silicon#83), the zink split-query readback fix (aurora-silicon#84)
and the virtio queue-limits fix (aurora-silicon#86).

The conflicts in the acceleration-structure sources and hk_query_pool.c
are resolved as in the earlier PR aurora-silicon#80 merge 8b7395e. That merge also
carried 2a541c6, which is held back here (see the PR).

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@RyanTheTide
RyanTheTide deleted the fix/hk-oq-resolve-from-end-20261027 branch October 30, 2026 03:22
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.

1 participant