Repository navigation
tests: mem_admit_route and laya_gguf_route take the port serve reports; census moves again (refs #1485) - #1555
Conversation
…s; census moves again Batch 4 of #1485, with the lock list and the census floor in the same commit (the #1537 lesson). - `mem_admit_route.sh`: the refusal case (a 4 TiB model) uses `--port 0` with no readiness parse - that serve is refused before it binds, so the port was decoration. The two `--no-mem-check` runs and the small-model run read the port back with `serve_port_wait`, inside the loop where the process is started. `newport()` is gone with its last caller. - `laya_gguf_route.sh`: both refusal cases (`--laya-model` without ggmlc's laya, `ONEBIT_LAYA_DEVICE=npu` without the NPU add-on) drop to `--port 0` with no parse; the daemon case reads the port back and only then builds `$api`. - `_onebit_route_tests` loses `laya_gguf_route` and `mem_admit_route` (neither pre-picks now), and the census floor goes 12 -> 10 with the comment updated: it counted 15 before this migration moved nine scripts to `serve --port 0`. Census rehearsed against a stand-in `ctest` built from the new lists: 3/3 cases pass. `bash -n` clean on both scripts; shellcheck warning counts unchanged against main (mem_admit 1, laya_gguf_route 5). Deliberately not in this batch, with the reason: `laya_models_e2e`/`laya_route_e2e` assert on serve's *output text* for refusals (they would need the parse only where they actually serve), `npu_repack_path` needs an NPU device and runs serve inside a `timeout`, and `kvshare_fd_handoff.py` is python spawning serve itself.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 9e761c9d.
newport() is gone with nothing left pointing at it — the check a deleted helper deserves, and the strongest form of it: git grep newport over the whole
tree at this head returns zero references, so neither the definition nor a caller survives anywhere (not just in the two scripts).
The census moved in the same commit again, and the arithmetic says it was counted rather than guessed: the lock list goes 13 → 11 names
(mem_admit_route and laya_gguf_route leave), the floor 12 → 10, and the comment's "seven scripts moved to serve --port 0" becomes "nine" — which
is 7 + these 2. A floor that moves in step with the thing it counts, with the reason written beside it, is what #1537 taught.
Static check of the property the census enforces (it cannot run here without a configured build, which is why your rehearsal used a stand-in): I listed
every tests/*.sh matching the census's own BIND_RE and diffed against the lock list. Nothing is missing — the unlocked binders are exactly the ones that
should be: hrx_cpu_weight_parity (runs llama-server, whose port is not ours) and hybrid_e2e/laya_models_e2e/laya_route_e2e/pm_laya_route (the
model/config-only APPEND list).
Mechanical: bash -n clean on both; shellcheck per file identical to main (mem_admit_route 1 SC2034, laya_gguf_route 5 SC2034 — unchanged); zero
s.bind(("127.0.0.1", 0)) left in either. mem_admit_route's --port 0 on an arm that is refused before it binds is right, with the reason in the comment.
One pattern worth deciding once, because this is the third time: both scripts call serve_port_wait "$log" "$pid" without a budget, so the helper's
default 30 s applies.
laya_gguf_route port budget 30 s health window 300 x 0.1 = 30 s exact
mem_admit_route port budget 30 s health window 100 x 0.1 = 10 s 3x the window
For laya_gguf_route that is a match by coincidence; for mem_admit_route it is a 3x margin (batch 3's serve_e2e was 2x). Not blocking — the margin errs
toward waiting rather than failing a good build, and kill -0 catches a dead serve immediately — but the convention "pass the health window as the budget,
or say why the margin is larger" would make the next batch mechanical instead of another judgement call.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 9e761c9d27e81974499e4a63a87b829930f853bd
Two more scripts off the pick-a-port-and-release-it pattern, and both now read what serve reports:
leftover bind(0)/socket picking in tests/laya_gguf_route.sh: 0 (was 1)
leftover bind(0)/socket picking in tests/mem_admit_route.sh: 0 (was 1)
serve_port_from_log/wait call sites: 1 and 3
and the shared helper still parses the suffixed ready line (…:8095 (laya-models: x) → 8095), so the lazily-routed serve path these tests use is covered by the same extractor #1531 fixed.
The comment is the right one to leave behind: "--port 0 for every serve below: the kernel picks and serve reports the port it bound, so nothing is picked and released before serve binds (engine #1444/#1485). The two refusal cases need no port at all; the daemon case reads the port back from serve's ready line." That last clause is the useful part — the refusal arms genuinely do not need a port, and saying so stops a future reader from adding a --port 0 there "for consistency" and then wondering why it hangs.
Both scripts parse, and both now source tests/serve_port.sh rather than carrying their own extractor, which is the property that keeps the four ready-line shapes fixed in one place.
Not run: the two suites end to end (they need 1bit and a --laya-model pack); the port handling is what changed and it is the helper I verified on six log shapes earlier.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
Refs #1485, batch 4. Lock list and census floor in the same commit — the #1537 lesson, applied for the second time.
What
tests/mem_admit_route.sh: the refusal case (a 4 TiB model that serve rejects before binding anything) uses--port 0and reads nothing back — the port was decoration. The two--no-mem-checkruns and the small-model run takeserve_port_waitinside the loop, since each iteration starts its own process.newport()is deleted with its last caller.tests/laya_gguf_route.sh: the two refusal cases (--laya-modelwithout ggmlc's laya,ONEBIT_LAYA_DEVICE=npuwithout the NPU add-on) are--port 0with no parse; the daemon case reads the port back and only then builds$api— previously$apiwas computed from a guessed port before any serve had started._onebit_route_testsdropslaya_gguf_routeandmem_admit_route; the census floor goes 12 → 10, with the comment updated to say it counted 15 before this migration moved nine scripts toserve --port 0.Verified
bash -nclean on both scripts.ctestbuilt from the new lists: 3/3 cases pass.buildjob runs the census andmem_admit_route.Deliberately not in this batch
laya_models_e2e,laya_route_e2e: they assert on serve's output text for refusals; they need the parse only where they actually serve, so they want their own read-through rather than a sweep.npu_repack_path: needs an NPU device, and runs serve insidetimeout(the pid to watch is the wrapper's).kvshare_fd_handoff.py: python, spawns serve itself.hrx_cpu_weight_parity: out of scope permanently — it runsllama-server, not1bit serve; its port is not ours to choose. That is now written in the lock-list comment so the next person does not re-litigate it.