Repository navigation
honeykrisp: validate the existing Aurora capture/replay heap - #18
joshuaswarren wants to merge 3 commits into
Conversation
The capture/replay range exists on this branch already. A fixed replay request outside it reached util_vma_heap_alloc_addr, which asserts on a range that wraps. A request inside it that is in use looked like running out of device memory. Record the range, add agx_va_capture_valid (the guard counts as part of the allocation, and nothing wraps), refuse an invalid fixed request in the allocator, and return VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS from vkCreateBuffer for an address outside the range or in use. Add a unit test of the range, the validity cases, the in-use case, and that ordinary allocations never land in the range. Not measured: a GPU run, or the Vulkan capture/replay CTS groups. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
|
Thanks Josh, this is a nice cleanup of the #9 heap. We ran #18 at fba14a0 on G15G, the capture/replay and error-return check you said it needed. Setup: 13" M3 Air (J613, G15G), kernel 7.2.11 (integration/aurora with the T8122 runtime and #236), m1n1 with the #14 dcpext gate. Vulkan-only build, buildtype plain + optimization 2 + b_ndebug=true like the mesa-aurora package, loaded from a private prefix via VK_ICD_FILENAMES (LD_DEBUG confirmed the private libvulkan_asahi.so). Baseline is the system vulkan-aurora built from 97a65d8.
VK-GL-CTS 1.4.6.2:
No Fail, Crash or Timeout, and no GPU fault in the kernel log. capture_replay is 10 Pass (capture_replay_stress) and 600 NotSupported. Those 600 need descriptor_buffer, ray tracing, descriptor_heap or NV device_generated_commands, not BDA capture/replay, which is advertised and works. #18 doesn't change feature bits. CTS has no case that expects VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS, so the new error returns are only covered by test-hk-va, which passes here. One question from reading the code (not a run): the replay heap is only set up when agx_chip_native_agx3() is true (agx_device.c:1288, agx_chip.h:173), so on G13/G14 hk_CreateBuffer never sets AGX_VA_CAPTURE_REPLAY (hk_buffer.c:137), while bufferDeviceAddressCaptureReplay is advertised on every chip (hk_physical_device.c:445). That looks like the M1 replay failures #9 fixed would come back on integration/aurora. Is that intended, or should the heap cover G13/G14 too? Small nit: the comment above that check (agx_device.c:1284-1286) still says "only for G17P", but the condition covers every native AGX3 chip. From the M3 side we see no regression and the G15G path checked out. The open question is M1/M2. |
|
One follow-up after a closer read: the "is in use" branch in hk_buffer.c isn't behind the replay-heap check, so on M1/M2 a failed fixed-address allocation now returns VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS instead of VK_ERROR_OUT_OF_DEVICE_MEMORY. That looks like the code the spec wants, but nobody has run it on G13/G14. With that noted, and the G13/G14 replay heap as a separate follow-up, we'd be happy to see this land from the M3 side. |
|
Just saw 168693e extends the replay heap to G13/G14, thanks, that answers our question. We'll rerun the M3 Air CTS at the new head and post the result here. |
|
Rerun at 168693e on the same M3 Air (G15G), same build options, private prefix: no change.
That matches the code: G15G was already inside the agx_chip_native_agx3 set, so dropping the gate only adds the reservation on G13/G14. Those paths (and virtio, if it reaches this code; the old comment said other winsyses own their VA) need their own run, which this one can't cover. |
|
We also covered the error returns that CTS doesn't test. A small standalone Vulkan test (bufferDeviceAddress + bufferDeviceAddressCaptureReplay, one process per case) on the same M3 Air (G15G), against 168693e and, for contrast, the system 97a65d8:
D is the memory side, which #18 doesn't touch; the spec allows SUCCESS there. No crashes and no GPU fault in the kernel log. The validation layer wasn't installed on this machine, so these ran without it. Happy to share the test source. G13/G14 still need their own run. We have a G14X (M2 Max) and plan to run the same test plus capture_replay_stress there. |
|
Could you share the source for the six standalone Vulkan address/error-return cases, plus the capture_replay and BDA case list or the command used to make it? I need the same inputs for the G13G comparison at 168693e against system Mesa. The G15G results will keep their stated scope. |
|
G14 results. We ran the same checks on a 14" M2 Max (J414c, G14X), comparing #18's base 147a62f against head 168693e, both built the same way into private prefixes, with the system Asahi 26.2.5 as a reference.
VK_LAYER_KHRONOS_validation 1.4.363 was loaded in every return-code run (base, head and system, with and without it) and reported nothing. No Fail, Crash or Timeout, and no GPU fault. The extra NotSupported on G14 are feature limits (vertex pipeline stores and atomics, descriptor set number), not #18. So on G14 the head fixes the replay collision the new commit targets, and on G15G (earlier comments) it changes nothing. That leaves G13. We'll share the test source and the two case lists separately for your G13G run. |
|
Here are the inputs for the G13G comparison: https://gist.github.com/scottjones/c93ae68c8a817123310d32758d31d341
We compared runs case for case on the per-case results, not just the totals. |
|
Thanks, Scott. The G14X run at 168693e closes that targeted device gap: replay works, ordinary buffers stay outside the replay range, and the invalid-address cases return the right error. We will keep this head unchanged and use your test source and case lists for the G13G comparison. Our G13G build passes all 57 Asahi tests, but its device checks are still open. The PR stays draft until that gap is closed. |
|
Tested on a 13-inch M1, G13G B1. Used Scott's API test. The new driver is
OOM means The new driver passed all six cases. D permits success or an invalid-address error. It does not check that the echo matches. Each row used the right ICD manifest. The log names it. The result file also holds the ICD and driver hashes. This is Scott's standalone API test, not CTS. The validation layer is not installed. It was off for both drivers. Result JSON SHA256: |
|
Ran the selected G13 CTS tests on a 13-inch M1. The new driver was The list has 362 cases. It covers buffer capture/replay, ten stress seeds, matched ordinary (non-replay) controls, feature checks, and buffer descriptor/heap cases.
There was no regression among the 118 cases with a single clean baseline Pass. Another 93 had a single clean NotSupported result. This does not show that no case regressed across all 362. The baseline was not rerun. This is a CTS subset, not full CTS. NotSupported cases are not passes. CTS ELF SHA256: |
|
Ran the same 362 selected CTS cases on one 13-inch M1 (G13G). The PR driver was built from
Each driver has one result for each case. All 122 changes were ResourceError to Pass. Neither driver had a Fail or Crash result. The comparison found zero regressions in these 362 cases. The 122 NotSupported cases stayed NotSupported on both drivers. This replaces the incomplete baseline in my earlier comment. Both arms are now complete. This is a CTS subset, not full CTS. It covers selected buffer-device-address and capture/replay cases, with matched ordinary (non-replay) controls. The run took 22 seconds: October 27, 05:43:11 to 05:43:33 UTC. SHA256 hashes:
The CTS executable's source commit is not independently verified. |
|
GREEN at 168693e Independent read of both commits (8 files, +208 -13) and of the evidence comments. I did not run any GPU work; I checked the code and the arithmetic. Code, read at this head:
Evidence, checked for consistency:
Notes, none blocking:
Not checked: any hardware run, a virtio run, the full build of the driver, and the meson test on my side (I ran the range function and the real heap in a stand alone program, not the PR's own |
[Medium impact] The PR appears safe to merge; both previous test findings are fixed, and no new actionable issues were found. SummaryThe PR checks fixed replay addresses against the reserved capture range, including guard space, and enables the existing replay heap on older chips.
Reviews (2) · Last reviewed commit: "asahi/tests: fill the ordinary VA heap a..." · Reviewed by Greptile |
…est-hk-va The exhaustion loop allocated at most 256 GiB from a 960 GiB ordinary heap, so the heap never ran dry and the later oversized request failed on size alone. It also dropped each agx_va pointer without agx_va_free. Allocate 4 GiB at a time until a request fails, require that at least 200 succeeded and that the cap was not hit, then check a small ordinary request, an oversized request and a replay-range request against the dry heap. Free every allocation before the heaps are closed. Tested: not run locally. CI runs hk_va in the asahi suite on this commit.
|
GREEN at 0fc1ab0 Read the one new commit over my earlier GREEN head Checked by building the unmodified test file from this head with the real
CI at this head: the x86_64 and aarch64 builds pass, Not checked: any hardware run (not needed for a test only change), and the full driver build; I built the test in a stand alone program. |
|
A question for the maintainers before this PR goes further. integration/aurora now gates the capture/replay heap, and this PR removes that gate.
What the unconditional heap did in our runs, at the old base: on a 13-inch M1, 122 of 362 selected CTS cases went from ResourceError to Pass, with no Fail or Crash on either driver. On a 14-inch M2 Max the two CTS lists matched the base case for case and the new error codes were returned. On a 13-inch M3 Air nothing changed. Which do you want?
We will rebase after you answer. Not checked: virtio, and whether any other winsys reaches this code. |
Head:
0fc1ab003886a1160a95683a6d378e8c4e6e690f. Target:integration/aurora.The head differs from the reviewed and device-tested head
168693eac1d6a55e9da8abc863f533f161f4b00bby one commit that changes onlysrc/asahi/vulkan/tests/test-hk-va.c. It makes the exhaustion test fill the ordinary heap and free what it allocates. No driver code changed, so the device results below stand at168693eac1d.This is the Aurora version of #9, not the main-based commit. It checks fixed replay addresses against the capture range and its guard page. A bad address, or one still in use, returns
VK_ERROR_INVALID_OPAQUE_CAPTURE_ADDRESS.The native-AGX3-only heap gate was already in Aurora base
147a62f619001f5f2588c7417c2b1fac3b0d93ad. The cleanup did not add it. Commit168693eac1dextends the scope: it enables the existing heap on G13/G14 too. Firmware reservations, AGX3-only alias heaps and cleanup are unchanged.GitHub says this head is MERGEABLE, with no text conflicts with
integration/aurora. An independent reviewer posted GREEN at168693eac1dafter reading both commits and testingagx_va_capture_validagainst exact arithmetic and the realutil/vma.cover 6,000,000 cases, with no mismatch.Checks at this head
ci / resultpass. The attested candidate job was skipped.meson test --suite asahi57/57. CTS 1.4.6.2 fixed list: 4,058 cases, 1,648 Pass and 2,410 NotSupported. Capture/replay plus BDA list: 5,320 cases, 3,376 Pass and 1,944 NotSupported. Both match baseline97a65d8. No Fail, Crash, Timeout or GPU fault.147a62f619against this head. The same API checks, now returning INVALID_OPAQUE_CAPTURE_ADDRESS. The fixed list and the 5,320-case list match the base case for case. The validation layer was loaded and reported nothing.These are targeted checks, not full CTS.
Limits
69bde15340, not the branch base. It shows what the head does on a 13-inch M1. It does not isolate this PR from other differences between those two drivers.agx_open_device, so it now gets the heap too. No virtio run exists.No main-based #9 result qualifies this PR, and no landing-order change is requested.