compass(tests): pin RAPIDSERVE_RPCS to the RapidServe cores waited broadcasts - #396
Conversation
…roadcasts (#394) `RAPIDSERVE_RPCS` must equal two sets derived from source by `test_runner_rpc_surface.py`'s `SITES`, `BASE` and `RAPID`: - the names `PrefillEngineCore` and `DecodeEngineCore` broadcast with a wait, minus the names `ModelRunner` defines; - the broadcast names `RapidServeModelRunner` defines, minus the names `ModelRunner` defines. A name dropped from or added to the tuple, or a new waited broadcast in either RapidServe core, now fails the test. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
| for name, sites in surface.SITES.items() | ||
| for s in sites | ||
| if s.waits | ||
| and s.file == "engine_core.py" |
There was a problem hiding this comment.
Non-blocking. An observation, not a change request: s.file is a basename, so a second engine_core.py is filtered by this file's class line ranges.
Site.file is path.name (test_runner_rpc_surface.py, _call_sites), and the tree has two files with that name: atom/model_engine/engine_core.py and atom/diffusion/engine/engine_core.py. This filter passes sites from both, then checks their line numbers against PrefillEngineCore/DecodeEngineCore in the first one.
Measured (X4, xiaobizh_n18_cpu, copy of merged tree 265770218). I appended 700 comment lines to atom/diffusion/engine/engine_core.py and then a module-level call_func("diffusion_only_rpc", wait_out=True), which lands at line 939, inside PrefillEngineCore's range. Result: 1 failed, 7 passed, failing on this test at :69. That red is false, because no RapidServe core makes that call.
It is latent today. The diffusion file has 235 lines and no call_func, so it would have to grow past line 816 before this could fire. The precise fix, carrying the relative path in Site, is in test_runner_rpc_surface.py, outside this PR's file set, and the false red is loud rather than silent. So I am not asking for a change and not filing an issue. Principle 6 ("Refuse rather than fall back. A declined answer with a named reason is a result. A guessed one is a defect.") is the reason to record it: file identity is guessed from the basename here.
|
Review cycle 1: PR #396 (issue #394), head Written by a reviewer agent. Verdict: APPROVE I read the eight design principles in 1. The changed lines
2. MutantsI reproduced three of the developer's mutants and designed eight of my own (X6 is in section 3). Each one edits a copy of merged tree
The helper candidate from the brief (X1, X1b). The 3. The double equality: justified, keep both halvesI evaluated each half alone, on the same mutants:
F1. Non-blocking, about the PR body. Principle 8: "Every claim carries its measurement. A number without a source is a defect." The body credits the 4. ponytail-review
5. Gate 1: the merged tree
🤖 Generated with Claude Code |
…unner, in overrides.py and design 01 (#397) Since #386, Config raises ValueError when enable_rapidserve is set with a runner_qualname not in RAPIDSERVE_RUNNERS. Two passages still described that combination as reachable: - the Scope comment above RPC_SURFACE in atom/compass/runner/overrides.py ("seven silent parks ... nothing in this module closes that gap"); - the time.sleep(2) entry in design 01 ("a simulated runner plus that flag would reach the sleep"). Both now say Config refuses the combination and name RAPIDSERVE_RUNNERS. The overrides.py change is comment-only; its AST is identical with comments and docstrings masked. Named-result check: with the design doc's wrapped lines joined, "would reach the sleep" occurs once at the base and zero times at the head, and "silent parks" zero times in both files. A line-by-line grep cannot see the wrapped phrase at either end. Ordering: the review's probe keeps the real engine_core_mgr and records engine-core construction and multiprocessing.Process. It shows LLMEngine raises at Config (llm_engine.py:43) before any engine core is constructed. A mutant that builds a PrefillEngineCore before Config shows up in that probe. The developer's manager-level stub observes only that neither core manager is called. Gate (node 18, CPU tier, combined with #396 on b7cd11d): 5276 passed, 155 skipped, 3 xfailed, GATE_CPU_RC=0. Closes #387 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Closes #394
What changed
One test in
tests/compass/test_rapidserve_runner_config.py, +19 lines.test_runner_rpc_surface.pyis not touched.test_the_rpcs_named_are_the_waits_only_the_rapidserve_cores_makeasserts:It uses
test_runner_rpc_surface.py'sSITES,BASE,RAPID,ENGINEand_classesthrough a module import (import test_runner_rpc_surface as surface).test_runner_step_semantics.pyalready importsSITESfrom that module the same way. There is no second scan of the source:waitedis the names inSITESwhose site is inengine_core.py, haswaits, and has a line insidePrefillEngineCoreorDecodeEngineCore. That is the refusal message's claim that "the RapidServe engine cores call ... and wait for each reply".rapid_onlyis(set(SITES) & RAPID) - BASE. This is the reviewer's form: the broadcast namesRapidServeModelRunnerdefines andModelRunnerdoes not.Each half catches a mutant the other half misses (M3/M3b and M4 below).
Named result: mutants
Run on
xiaobizh_n18_cpuon node 18, against the staged branch tree at52551552a(atom.__file__under the staged root). Each mutant edits one file in a copy of the tree, and the file is restored andcmp-checked afterwards. The whole file is run, 8 ids."prefill_forward"fromRAPIDSERVE_RPCSatom/config.pyRAPIDSERVE_RPCS == waited - BASE: extra in right'prefill_forward'"_bind_kv_cache_to_modules"(aRapidServeModelRunnermethod that is never broadcast)atom/config.pyRAPIDSERVE_RPCS == waited - BASE: extra in left"never_broadcast"atom/config.pyRAPIDSERVE_RPCS == waited - BASE: extra in leftcall_func("drain_prefill_stream_pool", wait_out=True)inPrefillEngineCoreengine_core.pyRAPIDSERVE_RPCS == waited - BASE: extra in right'drain_prefill_stream_pool'drain_decode_stream_poolinDecodeEngineCoreengine_core.pyRAPIDSERVE_RPCS == waited - BASE: extra in rightcall_func("_bind_kv_cache_to_modules", wait_out=True)in the baseEngineCoreengine_core.pywaited - BASE == rapid_only: extra in right'_bind_kv_cache_to_modules'call_func("drain_prefill_stream_pool")inPrefillEngineCoreengine_core.pyThe only failing id in every red row is the new test.
RAPIDSERVE_RPCShas 7 names, so an empty derivation fails the comparison. Every red row above shows it biting.RapidServeModelRunnermethod. The engine-core half alone holds on M4. Both hold on M0.Gate 1: the merged tree
git merge-tree --write-tree f89b1492c 52551552agives tree6f141d065. It was staged intoxiaobizh_n18_cpuwithgit archiveanddocker exec -i ... tar -xat a private path, with the.compass-commit/.compass-changedstamps. It was run with the tree's ownscripts/compass/gate_cpu.sh, and the gate printedatom: /tmp/i394/merged/ATOM/atom/__init__.pyandcommit: 5e40d0289 (stamp).GATE_CPU_RC10a664256(brief)f89b1492c+52551552af89b1492cdiffers from10a664256only inatom/compass/AI_DEV_RULES.md, which no test or gate script reads.--collect-onlyon both staged trees, with the gate's own ignore list: tipf89b1492c5412, merged 5413. The only difference is+ tests/compass/test_rapidserve_runner_config.py::test_the_rpcs_named_are_the_waits_only_the_rapidserve_cores_make, which passed in the gate's junit.🤖 Generated with Claude Code