Repository navigation
selftests: asahi-m4: mock capacity-limited VM snapshot pushes - #4323
Conversation
The VM slot test compiles Registry::snapshot() against a mock KVec. Model the kernel method directly so the fixture builds on stable Rust and enforces the no-growth contract. Signed-off-by: DjDeveloperr <hey@djdev.me>
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Reviewed 194d13e58ca74e990ccfb43fba27624fcec6020b. The seven added lines are confined to the VM-slot host fixture. The mock now has the inherent method Registry::snapshot() calls. Like kernel KVec, it appends only when spare capacity exists, and a full buffer returns the original element. The mock returns the element directly where the kernel wraps it in PushError<T>.
I reproduced E0658 with the fixture from main 9ece2d8202d2, then ran test-vm-slots.py with the exact head fixture and the same production G16 inputs on stable Rust. All 7 tests passed. A separate scratch assertion also passed for zero capacity and a filled buffer, including unchanged contents, allocation address, and capacity on rejection.
Hosted host-tests passed 1,197/1,197 at this head. pr-text and readiness succeeded. I found no blocking issue.
Summary
The VM-slot host test stopped compiling after #3990 added
Registry::snapshot(). Its mockKVeclacks the kernel'spush_within_capacity()method, so Rust resolves the call to the unstable standard-libraryVecmethod throughDeref.Implement the kernel method in the fixture. It returns the element if the buffer is full and appends without reallocating when space is available.
Tested
No runtime change.
ASAHI_M4_KERNEL="$src" ASAHI_M4_OUTPUT="$out" python3 "$src/tools/testing/selftests/drivers/gpu/asahi-m4/test-vm-slots.py"reproduced E0658 on main9ece2d8202d2and passed 7/7 with the patch. The fixture used the production G16 inputs from that main commit. The original failure is in post-merge host-tests.Risk: two-way door. The change runs only in the VM-slot host-test fixture and leaves capacity enforcement in the test stub.