Skip to content

test: prove VirtualBox methods observe the same VM state - #309

Merged
Wenzel merged 2 commits into
devfrom
vbox/cross-method-consistency
Oct 12, 2026
Merged

Wenzel merged 2 commits into
devfrom
vbox/cross-method-consistency

Conversation

@Wenzel

@Wenzel Wenzel commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Closes #286.

Adds opt-in cross_method_consistency, requiring VBOX_TEST_CROSS_METHOD=1, exact filter, VBoxVMI method and 2 vCPUs. It attaches MachineDebugger and VBoxVMI concurrently to the same paused VBoxHeadless process (test-only combined branch Wenzel/virtualbox:vmi/cross-method-test) and:

  • compares exact complete registers for each vCPU;
  • compares every byte in live PGM RAM ranges directly, no core intermediary;
  • proves memory writes MD→VBoxVMI and VBoxVMI→MD, then restores and verifies through both;
  • proves SYSENTER register writes in both directions, restores and verifies through both;
  • uses unwind guards for byte/register restoration and VM resume.

Ordinary virtualbox_ suites exclude it; unfiltered runs without opt-in print SKIPPED; filtered invocation without opt-in fails. integration_filter covers selection behavior.

Verified live:

RAM Bytes compared Above 4 GiB vCPUs Result
512 MiB 536,477,696 0 2 pass
5120 MiB 5,368,315,904 1,610,612,736 2 pass

The 5 GiB run writes/restores page 0x15fff6000 above 4 GiB. fmt, clippy -D warnings and integration_filter pass.

@Wenzel
Wenzel merged commit 1440b6f into dev Oct 12, 2026
22 checks passed
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