Repository navigation
tests: isolate CCD pools and quantization refusals - #718
Conversation
There was a problem hiding this comment.
Verdict: CLEAN: The fixture changes preserve the tested contracts and isolate process-wide state.
Checked
Duplicates: 2 new items checked. The helper extracts the existing MoE subprocess harness and serves three tests. No new duplication found; dryer reported 0 pairs.
Complexity: crapper flagged no changed functions.
Silent failure: 3 sites followed: the subprocess result and two fixture lookups. Spawn failure, failed child, zero selected tests, and missing fixture entries fail assertions.
Tests: static mutation checks cover all four changed tests. Keeping the lane start at ops.rs:4109 returns unit 16 instead of 8. Using the sorted index at ops.rs:3824 fails the participant assertion. Accepting either refused algorithm at quant_config.rs:484 fails its refusal assertion. Dropping lever validation at ops.rs:4417 fails the MoE panic assertion.
Gates: no bands, tolerances, pins, or gate cases relaxed.
Adversarial checks: small parent pools, zero child tests, JSON insertion order, and aarch64 lever refusal are covered by process isolation or assertions.
Escape catalog: no C1–C4 patterns matched.
Notes
Cargo tests were not run during this review. The fixture contents and CCD lane geometry were checked independently.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
작업자 수와 JSON 키 순서에 따라 실패하던 단위 시험 세 개를, 어떤 환경에서도 같은 결과가 나오도록 고칩니다.
Part of #565. Tracked in #699.
What and why
Three unit tests fail on a supported setup before they reach the contract they check. The product code is correct in each case; the fixtures assume something the test does not set up.
a_ccd_dispatch_returns_the_error_of_the_lowest_failing_runasserts a pool of at least four threads and then searches pair sizes for a lane that crosses from one pair into the next. WithBLOOMERY_THREADS=6the search finds no such lane and the test panics withsome lane of CCD 0 crosses a pair. This came in withd872bfc79d22.a_profiled_ccd_dispatch_counts_busy_time_by_participantasserts a pool of at least eight threads. With a smallerBLOOMERY_THREADSit fails on that assertion, and it also reads the global profile table, which other tests in the same process reset and fill. This came in withd872bfc79d22.checkpoint_configs_declare_formats_or_refuse_by_nameincrates/hf/src/quant_config.rsfeeds one checkpoint config that holds aQ8_0head and anIQ2_XXSexpert, and expects the error for the expert. The config rejects whichever entry the JSON parser yields first. Withserde_json/preserve_orderthat is theQ8_0head, so the test fails with the right error for the wrong entry. This came in with8e55fa1297d8(placement, model, gpu-gates: --place tp plans GLM-5.3-Flash's Hugging Face checkpoint over N ranks, each in its own node's pool #519).Changes:
crates/model/src/ops.rs: the two CCD tests now run in a fresh process of the test binary withBLOOMERY_THREADS=8, so the pool has eight workers whatever the parent sets and the profile table is not shared with other tests. One helper,in_ccd_pool, is used by both tests. It asserts on the child's exit status and on its test count, so a child that runs no test is an error.crates/hf/src/quant_config.rs: theQ8_0head and theIQ2_XXSexpert are each parsed alone, and the test checks the refusal message names that format and module. The result no longer depends on JSON key order.No product code, public API, GPU path, gate, band,
unsafeor pin changes.Release notes: internal: three unit tests no longer depend on the worker count or the JSON key order.
Code shape
crates/model.cargo fmtis clean on the touched files with the repository's pinned rustfmt.cargo clippywas not run on this branch.Duplication found or removed (
path:line): none.What I ran
The two CCD tests fail on current main with six workers, and the quantization test fails with
serde_json/preserve_order:The panics were
needs a pool of 8 or more threads,some lane of CCD 0 crosses a pair, and the refusal of theQ8_0head where the test expectedIQ2_XXS.On this branch, the CCD tests pass at six worker counts (
BLOOMERY_THREADSof 1, 2, 3, 4, 6 and 8), and the quantization tests pass with and withoutserde_json/preserve_order:The two ignored CCD tests are the existing
hw_tests that pin the calling thread and read the machine's CCD topology. They stay ignored.Not run: the rest of the workspace test suite, clippy, and any GPU test or speed comparison. This change touches two test modules only.
Reproduce:
Hardware
The base run was on a Linux x86_64 host. The branch run was on a DGX Spark (Linux aarch64) in a CUDA 13.3.1 container with the repository's pinned
nightly-2026-08-28toolchain. All of these tests run on the CPU.What I ran into
This does not block the PR. The same fresh-process pattern already exists in
crates/model/src/moe.rs, and the other tests inccd_testseither run pure geometry over several sizes or are the ignored hardware tests, so I found no other test there that assumes a minimum pool size. The other refusal cases inquant_config.rsparse one bad entry at a time, so they do not depend on key order either.AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.