Repository navigation
test(server): prune tests that guard no behavior - #1031
Merged
Merged
Conversation
Remove 299 of 2178 test declarations (13.7%) across the C++, Python and shell suites, and the test-only production seams they kept alive. Each deletion names the remaining test that catches the same bug, or why no contract exists. Host coverage holds within 0.1 point (C++ 29.29 -> 29.26% lines, Python 51.89 -> 51.67%). Weak tests that could not fail are rewritten, the per-process test_tmp_path fixes a ctest -j flake, and a fresh preservation review restored 7 contracts whose only test had been removed, each checked by a production mutation the restored assertion catches. Co-Authored-By: Claude Opus 5.5 <[email protected]>
anchor_scan.{h,cpp} never had a production caller: cefa3ca added it
with only an include in the old qwen3 drafter, and c2569a0 deleted that
drafter. Live anchor forcing is inline in qwen35_drafter.cpp. Its test,
test_anchor_transitive.cpp, goes with it.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
gpu_sampler_microbench_when_enabled asserts only CHECK(true) and does work only under LUCE_SAMPLER_BENCH=1, which nothing sets; CI ran it as a no-op. Drop it, its helper, the chrono include and the variables.md row. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Label cpu the tests that need no GPU, model or env var but that no CI job ran: DS4V/DS4.1V image and vision, DS4 engram, dmix and mix-converter, deepseek4 and qwen35 roctx, qwen35 image and split-tree guard, recurrent snapshot, qwen4exp MTP and MTP dispatch, and server_cli_model_names (which adds luce_server to check-cpu). All pass in a CUDA check-cpu run with no GPU and the libcuda stub, as on the hosted runner. qwen4exp_prefix_cache stays unlabelled: on CUDA its KVFlash pager records events the stub refuses. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Graffioh
marked this pull request as ready for review
November 17, 2026 19:37
davide221
reviewed
Nov 17, 2026
davide221
left a comment
Contributor
There was a problem hiding this comment.
Code review
No issues found. Checked for bugs and logic errors in the changed code.
Reviewed 48ae7f3b · 1 candidate issue checked, kept at ≥70% confidence · add the code-review label to review again
Conflict in server/test/unit/test_server_unit.cpp: keep main's new close_kind test (#1029); the two per-format timing tests stay folded into the PR's loop over formats. Co-Authored-By: Claude Opus 5.5 <[email protected]>
dusterbloom
added a commit
to dusterbloom/lucebox-hub
that referenced
this pull request
Nov 18, 2026
test_server_unit.cpp: main's Luce-Org#1031 pruned the model-card props tests next to the three /props.kvflash tests; take main's version and keep the three tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes 299 of 2178 test declarations (13.7%) that guard no behavior, plus the test-only production code they kept alive. Coverage holds within 0.1 point, and the CPU tier loses its shared-temp-file flake.
The tests removed fall into these patterns:
Every deletion names the test that still catches the same bug, or says why there is no contract. Review the ledgers, not the diff (151 files): the reasoning per test is there.
Numbers
ctest -L cpu, GPUs hidden)-m "not server and not model and not slow"), lines / branchesDeclarations removed per lane:
The target was 20%. This stops at 13.7% because every remaining declaration has a named contract in its lane's
Retainsummary; about 25 medium-confidence deletions were skipped rather than cut on a guess.Per-file coverage drops over 5 points are all explained:
slot_kv.h);msg_type_name, which only builds log text;backend_ipc.h);glue_fusions.h,model_capabilities.h);quantize_draft_q8.py, whose keeper runs the CLI in a subprocess that coverage does not trace. Six mutations to the lost lines all turn that keeper red.Production code removed (test-only seams)
Each had no caller outside tests (repo-wide grep, rechecked by the reviewers):
ModelBackend::compress_batchdefault and the cluster forwarder; the per-backendcompress_batchstays as the helper eachcompress()calls.supports_kvflash/supports_mixed_backend_layer_splitgetters on the backend and layer-split adapter headers.QueryCaptureSlice(pflash_compress.h); the vector overload ofselect_inline_evict_victim(prefix_cache), moved into the test file.floor_to_chunk,serialized_kv_k_type(kvflash_pager.h);kvflash_turn_cut(prefill_helpers.h).truncate_verified_path(ddtree);single_replay_inherited_reason(gdn_single_commit.h).deepseek4_dspark_dump; the always-trueenabledparameter of the DeepSeek4 roctx callbacks.on/inert_whyand the twin gate'sinert_why, whichmmq.cualready covered.Fixed along the way
test_tmp_pathnow returns a per-process directory.Fentries in the ledgers). Examples:gdn_scalar_replay_bitsset an env var nothing reads; it now pins the scalar kernel and asserts one launch.test_moe_streamused a fill pattern with a 256-byte period, so every expert's bytes were identical and a wrong-expert bug passed.test_ds41_mxfp8registration restored. fb69671 had dropped it.Preservation review
Six fresh reviewers, one per area, compared what was deleted against what remains. They found 7 contracts that had lost their only test, plus 4 assertions that could not fail or were too weak. Each is restored, and each restore was mutation-checked (keeper red with the mutation, source restored byte for byte):
evict_stops_when_only_protected_remaintest_launch_policy.cppformatter_fails_closed_on_invalid_values< 1→== 0(pflash_drafter_ipc.cpp)test_disk_cache_save_async_queue_and_free_spacetile_choice_tabletest_deepseek4_render_system_only_gen_prompt.is not acall:sentineltest_parse_call_verb_glued_to_word_rejected.to the sentinel class (tool_parser.cpp)The reviewers also fixed:
test_rms_norm_scalenow skips only when the fusion never launched. A new skip had turned off a real check on gfx1201.test_flashprefill_kernelsis tightened from 1e-2 to 1e-3.CompressResult none{}value-initialized the struct, so it passed with or without theok = falsedefault. It is now default-initialized, as production builds it.test_moe_stream's fill pattern is the 256-byte-period bug listed above.Not run here: GPU tests
The GPU tests compile on HIP gfx1201 and CUDA sm_86 but were not run. Before merging, run the GPU tier on both vendors. These rewritten GPU tests have expected values worked out by hand or from source:
test_qn_split_fusionsargmax_ties_gpu(V=33, V=2)test_gdn_scalar_replay_bitstest_moe_stream(now registered as a ctest, CUDA only)test_flashprefill_kernelstest_rms_norm_scaletest_deepseek4_*HC{512,4}test_kvflash_gpu_massJudgment calls
deepseek4_mmid_grouped_cuda_*sub-ctests (two cmake scripts) were removed. They exercise the test binary's own CLI guards, skip code and benchmark loop. The parity ctest itself stays.test_qwen35_ar_input_order. Its CUDA row is now left out silently when no GPU is present, where it used to report SKIP.Follow-ups (not in this PR)
q5_mmid_grouped_cudareturns 77 except on sm_86, and the 3090 runner is commented out.gdn_single_*,gdn_scalar_replay_bitsandtest_moe_streamhave never run on the sm_121 runner, and lucebox3 has no step-time headroom.cpu(pass with GPUs hidden, not yet checked against the CUDA hosted build):test_image_input,test_image_resize,test_image_decode,test_gpu_page_pool,thinking_budget,test_tool_checks,test_ddtree_path,test_chain_spec_shapes,test_draft_swa,rocmfp4_reference,rocmfpx_reference.PrefixCache::confirm_inline_snap(about 50 tests seed state with it);SeqSlotManager(SlotKv &, int).write_shared_payload_segments(backend_ipc.cpp) has no direct test.test_flashprefill_kernelskernel 4 needs larger Q/K before a tighter bound means anything.test_concurrent_prefix_budget_allowance_clampingreads live available memory twice and compares the results, so it can fail underctest -j. It failed once in 5 full runs and passes alone.Follow-up commits
These answer the open questions. A Fable 5.2 review decided each one from the source.
Delete
src/pflash/anchor_scan.{h,cpp}andtest_anchor_transitive.cpp. They never had a production caller: cefa3ca only included the header, and c2569a0 deleted that includer.Delete
gpu_sampler_microbench_when_enabled. It asserts onlyCHECK(true)behindLUCE_SAMPLER_BENCH, which nothing sets.Label host-only tests
cpuso the hosted job runs them:server_cli_model_names. This last one addsluce_servertocheck-cpu.All of them pass in a CUDA
check-cpurun in docker with no GPU and thelibcudastub, set up like the hosted job (1318/1318).qwen4exp_prefix_cachestays unlabelled: on CUDA its KVFlash pager records events the stub refuses. Drop any label the hosted Build still turns red.Proposed test-ownership rules
These come from mistakes this campaign found repeatedly. Candidates for a
server/AGENTS.mdor the Tests section of DEVELOPER.md:server/src. Test through the real entry point, or move the helper into the test.test_tmp_path, never a fixed path in /tmp.The ledgers (one per lane: every deletion with its keeper, the carried assertions, the applied list), the six review reports and the coverage diffs are attached to LUC-284.
Part of LUC-284
🤖 Generated with Claude Code