Skip to content

selftests: asahi-m4: mock capacity-limited VM snapshot pushes - #4323

Merged
DjDeveloperr merged 1 commit into
mainfrom
fix/g16-vm-slots-fixture-capacity
Dec 4, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
fix/g16-vm-slots-fixture-capacity

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The VM-slot host test stopped compiling after #3990 added Registry::snapshot(). Its mock KVec lacks the kernel's push_within_capacity() method, so Rust resolves the call to the unstable standard-library Vec method through Deref.

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 main 9ece2d8202d2 and 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.

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>
@DjDeveloperr
DjDeveloperr requested review from a team as code owners December 4, 2026 14:04
@github-actions github-actions Bot added door:two-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Merge readiness at 194d13e5: not ready yet

Check Detail
CI at head running running: pr-text / pr-text
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok not needed: no runtime change
Conflicts ok none
PR text ok Risk: two-way · . The change runs only in the VM-slot host-test fixture and leaves capacity enforcement in the test stub.

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@github-actions github-actions Bot removed the needs-hw-row No hardware row at the PR head (bot) label Dec 4, 2026
@DjDeveloperr
DjDeveloperr merged commit 967fe02 into main Dec 4, 2026
7 checks passed
@DjDeveloperr
DjDeveloperr deleted the fix/g16-vm-slots-fixture-capacity branch December 4, 2026 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant