Repository navigation
borealis: submit packing follow-ups from the #488 reviews - #558
Conversation
Independent review of
|
| Mutation | Failing check |
|---|---|
Restore "HAL200 && no memory-scope form" in hk_pack_boundary() |
G17A: HAL200 but not G16, no boundary |
hk_sync_queue_kinds() returns ever in exact mode as well |
exact: a render forgotten in an earlier submission splits |
hk_pack_admits_strong_tail() returns boundary != NONE |
M5: no strong-flush tail, and the trace says so |
hk_pack_admits_strong_tail() returns false |
G16G: a strong-flush tail, and the trace says so |
G16 member check accepts only weak_barrier_end |
G16G: a strong-flush tail, … |
M5 member check relaxed as in #506 (strong_flush_end == end only) |
M5: no strong-flush tail, … |
So the exact-vs-legacy test (finding 5) does tell the two lookups apart, and no pre-existing check does: in the second mutation it is the only failure.
The aurora-packtest must-pack logic was checked with a harness that calls trace_line() and must_pack() directly:
strong_tails=0makeschain242not must-pack and leavesdisjointmust-pack;=1makes both must-pack;- with no line seen yet, the value is
-1, which counts as must-pack (the old behaviour); - after a render,
chain-allis not must-pack.
The case lists are classified correctly: multi-tail and disjoint end with an OP_MIX, and the other five end with OP_BARC/OP_BAR. With no trace available, only must-pack cases FAIL.
The G16G rationale now matches linux#2419 as written there: "compute commands queue behind the same VM's in-flight compute on the one firmware compute queue", and "only the same VM queues".
Findings (most severe first, all low)
L1. hk_pack_admits_strong_tail() mirrors hk_pack_run_member() instead of being used by it. hk_pack.c:56, hk_pack.c:101
- Scenario. The PR says hk: pack M5 command buffers that end in a barrier without memory scope #506 "should flip this one function", but hk: pack M5 command buffers that end in a barrier without memory scope #506 edits the visible-completion branch of
hk_pack_run_member()and leaves this function alone. Rebased onto this PR, hk: pack M5 command buffers that end in a barrier without memory scope #506 fails the M5 check attest-hk-pack.c:506, which is what we want. But if the check is then "fixed" on therun_memberside only, the trace keeps printingstrong_tails=0while M5 packs barrier-ended chains.aurora-packtestthen silently stops requiringchain242/chain300/loops/chain-all/multion M5. - Fix. Make the predicate the single source of truth inside the member check, for example in the visible-completion branch:
if (cs->strong_flush_end != end || (!hk_pack_admits_strong_tail(boundary) && (!cs->visible_completion || cs->memory_flush_end != end))) return NULL;. hk: pack M5 command buffers that end in a barrier without memory scope #506 then really flips one function. At minimum, tell hk: pack M5 command buffers that end in a barrier without memory scope #506 that it must flip this function and invert this check.
L2. With a driver older than this commit, aurora-packtest still fails barrier-ended cases on M5. tests/aurora_packtest.c:812, :841, :969
- Scenario. This head's packtest runs against an M5 driver without the
strong_tails=field. The value stays-1, which counts as must-pack, sochain242etc. FAIL as before. The value is also sticky: a line without the field keeps the previous value. - Fix. None needed: falling back to must-pack is the right default. Say in the comment (or the PR text) that the relaxation needs a driver that has this commit, so an M5 row on an older driver isn't misread.
L3. The HK_PACK_ATOMICS nit has no test. hk_queue.c:2460
- Scenario.
hk_pack_atomics_allowed()is static inhk_queue.c, which no unit test links, so thefalse→truedefault isn't pinned. I verified it by readingdebug_parse_bool_option(). - Fix. Optional: move the env-to-bool decision into a small pure helper in
hk_pack.cand add a two-line check.
L4. Wording in the G16G atomics rationale. hk_queue.c:2445-2446
- "none runs beside a packet out of order" mixes overlap with order. The property atomics need is that the firmware runs the queued commands one after another and never beside another queue's.
- Fix. "…several commands of one VM may be in flight there, but the firmware runs them one after another, never beside a packet."
Nits
hk_pack.c:204(108 columns) andhk_queue.c:2383(83 columns): the comment rewrites weren't reflowed.hk_device.h:452still says "The other HAL200 parts (G16) have only the plain strong flush". With the new G17A note inhk_pack.c, it should leave G17A out or say its caches are unknown.
Independent review. Scope: the diff, plus local build and tests on the host. Not run on hardware.
🤖 Generated with Claude Code
|
Thanks. All fixed in one commit on top, new head bc0f0dc:
Local checks at this head (host aarch64, clang 23.1.1, release,
|
From the review of #558: - hk_pack_run_member() now asks hk_pack_admits_strong_tail() whether a member may end with a strong flush without memory scope, instead of restating the rule. The packing trace reports the same answer, so a change to one (mesa#506 admitting such tails on M5) changes both, and aurora-packtest's must-pack check follows it. - hk_pack_atomics_choice() is the HK_PACK_ATOMICS decision, now a pure helper with a test: on by default on G16G and opt-in elsewhere with one kernel queue; an unparsable value keeps the default. - aurora-packtest says that only a driver with the strong_tails= field relaxes the barrier-ended must-pack cases; with an older one on M5 without #506 they FAIL as before. - Comments: the G16G atomics rationale says the firmware runs a VM's compute commands one after another, never beside a packet; G17A's caches are not known (hk_device.h); two paragraphs reflowed. Signed-off-by: Diljit Singh <hey@djdev.me>
|
Thanks, the follow-ups read well and the mutation table makes the boundary change easy to trust. One small point on Could G17A be expressed through that property (in |
|
Rebased onto aurora-wip 263ddb7 (after #506 and #552) for the mesa merge train, plus one commit for RyanTheTide's 02:53Z request. Old head bc0f0dc -> new head 405a47c. Rebase.
New commit 405a47c (Ryan's request). The HAL200 boundary is again Next: a re-review of the rebased head, then batch 2 of the train (host build + |
bc0f0dc to
405a47c
Compare
From the review of #558: - hk_pack_run_member() now asks hk_pack_admits_strong_tail() whether a member may end with a strong flush without memory scope, instead of restating the rule. The packing trace reports the same answer, so a change to one (mesa#506 admitting such tails on M5) changes both, and aurora-packtest's must-pack check follows it. mesa#506 has since merged, so the rule now admits them at both boundaries, and the M5 case of the test expects the member and strong_tails=1. - hk_pack_atomics_choice() is the HK_PACK_ATOMICS decision, now a pure helper with a test: on by default on G16G and opt-in elsewhere with one kernel queue; an unparsable value keeps the default. - aurora-packtest says that only a driver with the strong_tails= field relaxes the barrier-ended must-pack cases; with an older one on M5 without #506 they FAIL as before. - Comments: the G16G atomics rationale says the firmware runs a VM's compute commands one after another, never beside a packet; G17A's caches are not known (hk_device.h); two paragraphs reflowed. Signed-off-by: Diljit Singh <hey@djdev.me>
From RyanTheTide's review of #558: the HAL200 boundary came from a G16 chip list so that G17A would be left out. It is again "HAL200 stream and no memory-scoped strong-flush form", plus hk_cdm_caches_pending(): G17A, between G17P and M5, whose caches have not been checked for virtual address tags. The boundary table is unchanged: HAL200 is G16P/G/S/C, G17P (memory-scoped form) and G17A (pending), so only the G16 parts get the strong-flush boundary. Signed-off-by: Diljit Singh <hey@djdev.me>
- The G16G rationale for packing global atomics, and the ordering note of the planner, now say what linux#2419 keeps true: the G16 kernel runs every compute command of a VM in order on its one firmware compute queue, never beside another VM's. It no longer runs one command of the device at a time. - The HAL200 boundary is limited to the G16 parts. G17A, the other HAL200 part, sits between G17P and M5, which both have tagged caches and a memory-scoped flush form; it has no boundary until its caches are known. G15's exclusion now gives its real reason: packing there is not qualified, not that its barrier differs. - An unparsable HK_PACK_ATOMICS keeps G16G's default (on), as before #488. - hk_pack_admits_strong_tail() says whether a member may end with a strong flush without memory scope, as an application barrier at the end of a command buffer leaves it: at the HAL200 boundary, which upgrades it in place, and not at the visible-completion boundary (M5), whose members must end with the memory-scoped flush. The packing trace reports it as strong_tails=, and a test pins it to what hk_pack_run_member() takes on G17S and G16G. - aurora-packtest's must-pack check follows it: cases whose command buffers end with a dispatch (multi-tail, disjoint) must pack wherever packing is on; those ending with a barrier (chain242, chain300, loops, chain-all, multi) only where the trace reports strong_tails=1. With no trace available, only must-pack cases fail. - hk_pack_test: an exact-prior queue whose earlier submission forgot a render splits as the resolver resolves it (last_absolute, not ever; from the fourth review), and G17A has no boundary. From the review of #558: - hk_pack_run_member() now asks hk_pack_admits_strong_tail() whether a member may end with a strong flush without memory scope, instead of restating the rule. The packing trace reports the same answer, so a change to one (mesa#506 admitting such tails on M5) changes both, and aurora-packtest's must-pack check follows it. mesa#506 has since merged, so the rule now admits them at both boundaries, and the M5 case of the test expects the member and strong_tails=1. - hk_pack_atomics_choice() is the HK_PACK_ATOMICS decision, now a pure helper with a test: on by default on G16G and opt-in elsewhere with one kernel queue; an unparsable value keeps the default. - aurora-packtest says that only a driver with the strong_tails= field relaxes the barrier-ended must-pack cases; with an older one on M5 without #506 they FAIL as before. - Comments: the G16G atomics rationale says the firmware runs a VM's compute commands one after another, never beside a packet; G17A's caches are not known (hk_device.h); two paragraphs reflowed. Signed-off-by: Diljit Singh <hey@djdev.me>
405a47c to
dcb27fc
Compare
From RyanTheTide's review of #558: the HAL200 boundary came from a G16 chip list so that G17A would be left out. It is again "HAL200 stream and no memory-scoped strong-flush form", plus hk_cdm_caches_pending(): G17A, between G17P and M5, whose caches have not been checked for virtual address tags. The boundary table is unchanged: HAL200 is G16P/G/S/C, G17P (memory-scoped form) and G17A (pending), so only the G16 parts get the strong-flush boundary. Signed-off-by: Diljit Singh <hey@djdev.me>
…OMICS From the train's review of the rebased #558: - hk_pack_admits_strong_tail() is true at both boundaries since mesa#506, so the member check's second strong-tail arm (memory scope plus visible completion) could never decide anything. The check is now a strong flush at the end where the boundary admits one, or an ordering barrier at the HAL200 boundary; the comment no longer describes a boundary that does not exist. Packing decisions are unchanged. - HK_PACK_ATOMICS also takes "on" and "off": debug_parse_bool_option() does not know them, so "off" left G16G's default (packed atomics) on. Tests for both. - The G17A boundary test is named after its reason (caches pending). Signed-off-by: Diljit Singh <hey@djdev.me>
Merge train (batch 2): independent re-review of the rebased head, and fixesVerdict on 405a47c: CLEAN WITH NITS. Independent code-only review (Opus 5.5, xhigh).
Fixed in the new head dcb27fc (force-pushed):
Left as is: the Commits: 64a1e73 (follow-ups + the shared tail rule), e1e35d1 (HAL200 boundary by property), dcb27fc (the fixes above). Syntax-checked against a configured tree. The full host build + |
RyanTheTide
left a comment
There was a problem hiding this comment.
No blockers. Our earlier comment is addressed. The HAL200 boundary is again HAL200 && !hk_cdm_memory_scope_form(), plus a named hk_cdm_caches_pending() with the reason G17A is held back (hk_device.h:553-562), as we asked. I re-read dcb27fc. The member check now takes its strong-tail rule from hk_pack_admits_strong_tail(), which the trace also prints, so the two cannot disagree. hk_pack_atomics_choice() keeps the previous G16G default and the M5 one-queue rule, and adds on/off. Packing decisions on today's kernels match aurora-wip, as the boundary table in the earlier review shows.
-
Evidence: the G16G hardware run was on the earlier candidate, not this head, and this head's aurora-packtest has not run on hardware. That is acceptable for a change that leaves decisions unchanged, but the M4 (G16G) and M5 Pro (G17S) rows still need to run before this is called proven.
-
Naming nit: the commit subjects start with
hk:. Our Vulkan driver is Borealis in prose, soborealis:as in the PR title.
Hardware row: Neo (A18 Pro, G17P), where hk_pack_boundary() is NONE. Run aurora-packtest with HK_PACK_CDM_TRACE=1 on base and head. Pass: no packet is formed, there are no must-pack failures, and the results match the base.
Assisted-by: LLM (Claude:Opus 5.5)
- The G16G rationale for packing global atomics, and the ordering note of the planner, now say what linux#2419 keeps true: the G16 kernel runs every compute command of a VM in order on its one firmware compute queue, never beside another VM's. It no longer runs one command of the device at a time. - The HAL200 boundary is limited to the G16 parts. G17A, the other HAL200 part, sits between G17P and M5, which both have tagged caches and a memory-scoped flush form; it has no boundary until its caches are known. G15's exclusion now gives its real reason: packing there is not qualified, not that its barrier differs. - An unparsable HK_PACK_ATOMICS keeps G16G's default (on), as before #488. - hk_pack_admits_strong_tail() says whether a member may end with a strong flush without memory scope, as an application barrier at the end of a command buffer leaves it: at the HAL200 boundary, which upgrades it in place, and not at the visible-completion boundary (M5), whose members must end with the memory-scoped flush. The packing trace reports it as strong_tails=, and a test pins it to what hk_pack_run_member() takes on G17S and G16G. - aurora-packtest's must-pack check follows it: cases whose command buffers end with a dispatch (multi-tail, disjoint) must pack wherever packing is on; those ending with a barrier (chain242, chain300, loops, chain-all, multi) only where the trace reports strong_tails=1. With no trace available, only must-pack cases fail. - hk_pack_test: an exact-prior queue whose earlier submission forgot a render splits as the resolver resolves it (last_absolute, not ever; from the fourth review), and G17A has no boundary. From the review of #558: - hk_pack_run_member() now asks hk_pack_admits_strong_tail() whether a member may end with a strong flush without memory scope, instead of restating the rule. The packing trace reports the same answer, so a change to one (mesa#506 admitting such tails on M5) changes both, and aurora-packtest's must-pack check follows it. mesa#506 has since merged, so the rule now admits them at both boundaries, and the M5 case of the test expects the member and strong_tails=1. - hk_pack_atomics_choice() is the HK_PACK_ATOMICS decision, now a pure helper with a test: on by default on G16G and opt-in elsewhere with one kernel queue; an unparsable value keeps the default. - aurora-packtest says that only a driver with the strong_tails= field relaxes the barrier-ended must-pack cases; with an older one on M5 without #506 they FAIL as before. - Comments: the G16G atomics rationale says the firmware runs a VM's compute commands one after another, never beside a packet; G17A's caches are not known (hk_device.h); two paragraphs reflowed. Signed-off-by: Diljit Singh <hey@djdev.me>
dcb27fc to
f3f5fd8
Compare
From RyanTheTide's review of #558: the HAL200 boundary came from a G16 chip list so that G17A would be left out. It is again "HAL200 stream and no memory-scoped strong-flush form", plus hk_cdm_caches_pending(): G17A, between G17P and M5, whose caches have not been checked for virtual address tags. The boundary table is unchanged: HAL200 is G16P/G/S/C, G17P (memory-scoped form) and G17A (pending), so only the G16 parts get the strong-flush boundary. Signed-off-by: Diljit Singh <hey@djdev.me>
…OMICS From the train's review of the rebased #558: - hk_pack_admits_strong_tail() is true at both boundaries since mesa#506, so the member check's second strong-tail arm (memory scope plus visible completion) could never decide anything. The check is now a strong flush at the end where the boundary admits one, or an ordering barrier at the HAL200 boundary; the comment no longer describes a boundary that does not exist. Packing decisions are unchanged. - HK_PACK_ATOMICS also takes "on" and "off": debug_parse_bool_option() does not know them, so "off" left G16G's default (packed atomics) on. Tests for both. - The G17A boundary test is named after its reason (caches pending). Signed-off-by: Diljit Singh <hey@djdev.me>
|
Merge train: rebased onto aurora-wip afcc08b (conflict-free; authorship kept). Head dcb27fc -> f3f5fd8.
|
- The G16G rationale for packing global atomics, and the ordering note of the planner, now say what linux#2419 keeps true: the G16 kernel runs every compute command of a VM in order on its one firmware compute queue, never beside another VM's. It no longer runs one command of the device at a time. - The HAL200 boundary is limited to the G16 parts. G17A, the other HAL200 part, sits between G17P and M5, which both have tagged caches and a memory-scoped flush form; it has no boundary until its caches are known. G15's exclusion now gives its real reason: packing there is not qualified, not that its barrier differs. - An unparsable HK_PACK_ATOMICS keeps G16G's default (on), as before #488. - hk_pack_admits_strong_tail() says whether a member may end with a strong flush without memory scope, as an application barrier at the end of a command buffer leaves it: at the HAL200 boundary, which upgrades it in place, and not at the visible-completion boundary (M5), whose members must end with the memory-scoped flush. The packing trace reports it as strong_tails=, and a test pins it to what hk_pack_run_member() takes on G17S and G16G. - aurora-packtest's must-pack check follows it: cases whose command buffers end with a dispatch (multi-tail, disjoint) must pack wherever packing is on; those ending with a barrier (chain242, chain300, loops, chain-all, multi) only where the trace reports strong_tails=1. With no trace available, only must-pack cases fail. - hk_pack_test: an exact-prior queue whose earlier submission forgot a render splits as the resolver resolves it (last_absolute, not ever; from the fourth review), and G17A has no boundary. From the review of #558: - hk_pack_run_member() now asks hk_pack_admits_strong_tail() whether a member may end with a strong flush without memory scope, instead of restating the rule. The packing trace reports the same answer, so a change to one (mesa#506 admitting such tails on M5) changes both, and aurora-packtest's must-pack check follows it. mesa#506 has since merged, so the rule now admits them at both boundaries, and the M5 case of the test expects the member and strong_tails=1. - hk_pack_atomics_choice() is the HK_PACK_ATOMICS decision, now a pure helper with a test: on by default on G16G and opt-in elsewhere with one kernel queue; an unparsable value keeps the default. - aurora-packtest says that only a driver with the strong_tails= field relaxes the barrier-ended must-pack cases; with an older one on M5 without #506 they FAIL as before. - Comments: the G16G atomics rationale says the firmware runs a VM's compute commands one after another, never beside a packet; G17A's caches are not known (hk_device.h); two paragraphs reflowed. Signed-off-by: Diljit Singh <hey@djdev.me>
From RyanTheTide's review of #558: the HAL200 boundary came from a G16 chip list so that G17A would be left out. It is again "HAL200 stream and no memory-scoped strong-flush form", plus hk_cdm_caches_pending(): G17A, between G17P and M5, whose caches have not been checked for virtual address tags. The boundary table is unchanged: HAL200 is G16P/G/S/C, G17P (memory-scoped form) and G17A (pending), so only the G16 parts get the strong-flush boundary. Signed-off-by: Diljit Singh <hey@djdev.me>
…OMICS From the train's review of the rebased #558: - hk_pack_admits_strong_tail() is true at both boundaries since mesa#506, so the member check's second strong-tail arm (memory scope plus visible completion) could never decide anything. The check is now a strong flush at the end where the boundary admits one, or an ordering barrier at the HAL200 boundary; the comment no longer describes a boundary that does not exist. Packing decisions are unchanged. - HK_PACK_ATOMICS also takes "on" and "off": debug_parse_bool_option() does not know them, so "off" left G16G's default (packed atomics) on. Tests for both. - The G17A boundary test is named after its reason (caches pending). Signed-off-by: Diljit Singh <hey@djdev.me>
f3f5fd8 to
1b433bb
Compare
|
Merge train: rebased onto aurora-wip 7ba2957 (#595, the CI fix that installs the GLVND EGL dispatcher, so the asahi job's EGL priority tests pass), conflict-free, every commit identical, authorship kept. New head 1b433bb. A mirror |
Merge train batch 1: mergedBatch 1 (#374, #388, #558, on aurora-wip Gate: slot
Assisted-by: LLM (Claude:Opus 5.5) |
Follow-ups to #488 (merged as 11ee623) from its third and fourth independent reviews (comments 7025084567 and 7025630906) and the M5 lane's re-review. One commit, no change in what packs on G16G or G17S today.
Changes
hk_cdm_memory_scope_form()doesn't list it. It sits between G17P and M5, which both have tagged caches and a memory-scoped flush form, so it gets no boundary until its caches are known. No current kernel admits G17A.HK_PACK_ATOMICSon G16G (nit). An unparsable value keeps the default (on), as before hk: pack runs of plain compute command buffers into one command #488.hk_pack_admits_strong_tail()says whether a member may end with a strong flush without memory scope, as an application barrier at the end of a command buffer leaves it.strong_tails=, and a test pins it to whathk_pack_run_member()accepts on G17S and on G16G.multi-tail,disjoint) must pack wherever packing is on.chain242,chain300,loops,chain-all,multi) must pack only where the trace reportsstrong_tails=1, so M5 rows without hk: pack M5 command buffers that end in a barrier without memory scope #506 no longer FAIL them by design.hk_pack_test: exact-prior queue history (finding 5). This is the reviewer's test: a render forgotten in an earlier submission on an exact-prior queue splits, as the resolver resolves it (last_absolute, notever). A G17A row is also added.Checks
-j2, 2 GiB cap:libvulkan_asahi.soandaurora-packtestbuild;meson test --suite asahi: 139 Ok, 0 Fail;hk_pack_test: 142 checks, 0 failures; random harness 3180 packets, history harness 4872 packets, 0 failures;strong_tails=1. This head's aurora-packtest (the boundary-aware must-pack) hasn't run on hardware yet. It runs in the next M4 slot, and an M5 row with and without hk: pack M5 command buffers that end in a barrier without memory scope #506 would check thestrong_tails=0path.Not in this PR
hk_cdm_alias_scope()false on G16G) get their own PR once the fix candidate's full CTS has run on the M4. That PR also adds thealias-*aurora-packtest cases.🤖 Generated with Claude Code