Skip to content

test: make recovery fixtures native-page-size aware - #65

Open
ziqifan617 wants to merge 1 commit into
mainfrom
codex/native-page-size-tests
Open

ziqifan617 wants to merge 1 commit into
mainfrom
codex/native-page-size-tests

Conversation

@ziqifan617

Copy link
Copy Markdown
Contributor

Summary

Fix two unit-test assumptions that fail on Linux hosts with 64 KiB pages, and extend the recovery test to exercise alignment explicitly. No production code changes.

Root causes and changes

  • test_a_guarded_startup_that_fails_gives_back_everything_it_took[g3-invalid] chooses a block size of mmap.PAGESIZE // 2, but its fake DRAM pool was fixed at 8 KiB. On a 64 KiB-page host, the 32 KiB block cannot fit, so startup fails before reaching the intended G3 validation/cleanup path. Size the fixture to hold two blocks and use the same block-size variable in the configuration.
  • test_a_handback_region_lives_and_dies_inside_the_pool_file compared snapshot telemetry against file size minus pool mapping size. That includes alignment padding: a 12,288-byte pool on a 64 KiB-page host introduces a 53,248-byte gap before the snapshot. Compare against the actual mapped snapshot length instead.
  • Parameterize the existing recovery/replay/torn-write/release checks over small, page-aligned, and unaligned pool sizes, adding two test cases without weakening the lifecycle assertions.

Validation

Previously executed on native GB300 Linux aarch64, 64 KiB pages, Python 3.12.3, pytest 8.4.2, NIXL 1.5.0. Baseline is fb4f2643fff47cffe0b21266e170f5569605f9b2; tested commit is 98242c1bb835ef68342478354f9a9b44402f3ba7.

Full unit suite Passed Failed
Baseline 432 2
This change 436 0

The increase from 434 to 436 total tests comes from the two additional pool-size parameter cases. Both original failures are reproduced on the baseline and pass with the changes. No tests were skipped or marked xfail.

  • python -m pytest -q tests/unit: 436 passed (87.15 s).
  • python -m ruff check src tests: passed.
  • python -m ruff format --check tests/unit/test_kvcr.py tests/unit/test_recovery_journal.py: passed.
  • git diff --check: passed.

The baseline and patched suites ran with GPUs hidden and isolated test dependencies. Both used a real parent process for pytest: invoking pytest directly through kubectl exec initially exposed an unrelated PPID-0 assumption in a pidfd test. Using the same parent-process wrapper for both runs restored the expected two-failure baseline; no unrelated test was changed. This is native host unit-test validation, not a new model-serving benchmark. A 4 KiB-page Linux run has not been performed for this change.

Implementation and validation were assisted by OpenAI Codex.

Size the guarded-startup DRAM fixture from its block size so 64 KiB-page hosts reach the intended G3 validation failure. Compare snapshot telemetry with the actual mapped region rather than counting alignment padding. Exercise small, aligned, and unaligned pools through recovery and cleanup.

Validated on aarch64 Linux with 64 KiB pages: baseline 432 passed / 2 failed; patched 436 passed. Production code is unchanged.

Assisted-by: OpenAI Codex
Signed-off-by: Ziqi Fan <ziqif@nvidia.com>
@ziqifan617
ziqifan617 requested review from karya0 and mkhazraee October 3, 2026 20:19
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