Repository navigation
tests: hybrid_kvshare_route asserts the share path, not a sub-millisecond clock (engine #852) - #858
Conversation
…cond clock (engine #852) The handoff check matched "share 0\.[0-9]* ms" while serve logs the share duration with %.3f, so any share of 1 ms or more -- which is what a loaded box produces -- made "the handoff ran" fail on a run where the handoff did run. The same regex is the negative arm at :76 ("no share/adopt line was reported"), where it fails the other way: a share line at 3.900 ms does not match, so the negated grep succeeds and a log that did carry a share line was reported clean. Both sites now match the path and any duration.
PR Reviewer Guide 🔍(Review updated until commit 5fafff7)Here are some key observations to aid the review process:
|
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at f5900b4ee
The defect and the fix both check out, and I reproduced the regex arms directly instead of taking the table:
| line | old :63 |
new :63 |
old negated :77 |
new negated :77 |
|---|---|---|---|---|
share 0.412 ms, first byte |
match | match | pass | pass |
share 5.929 ms, first byte |
no match | match | pass (wrong) | fail (correct) |
share 3.900 ms, first byte |
no match | match | pass (wrong) | fail (correct) |
| no share line | no match | no match | pass | pass |
So the old pattern asserted a sub-millisecond duration (the %.3f in app/serve.cpp prints 0.412 or
5.929), and the same regexp as a negation quietly passed on a log that carried a share line — both halves are
real, both halves are fixed, and no other site in the tree still carries the share 0\. form.
Run for real at this head, CPU, fake backend, no device: tests/hybrid_kvshare_route.sh <1bit> ->
11/11 checks ok, PASS, including both of the changed ones. bash -n clean; shellcheck -S warning reports
exactly the one pre-existing SC2034 at :74 (reply, read inside an eval) that the body names.
|
Persistent review updated to latest commit 88f1475 |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at 88f1475d6 (re-posted; my verdict is a gate only at the head it names).
Head moved by update-branch only: 88f1475d6 is Merge branch 'main' into 1bit/852-share-path-not-clock, parents f5900b4ee (the head I verdicted) and 1f2dfe99f. The PR's own commit is untouched and its single file blob is identical at both heads, so the earlier evidence applies verbatim: the two regex arms reproduced by hand on the four real log lines (the old :63 arm fails on share 5.929 ms, the old negated :77 arm wrongly passes on it; both new arms correct), and tests/hybrid_kvshare_route.sh run for real -> 11/11 ok, PASS.
CI on this head: build SUCCESS, four Analyze jobs SUCCESS, hw_gate SKIPPED, pr_agent SUCCESS.
Note: the branch is one main commit behind 801a4a60c; MERGEABLE, nothing conflicts, and the merge walk will update-branch it if main moves again.
|
Persistent review updated to latest commit a6f1000 |
|
Persistent review updated to latest commit 40fd4cd |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
At 40fd4cdd9 (the branch updated onto 692cfa25c), superseding my line at 88f1475d6.
The update added nothing of its own: 40fd4cdd9 is Merge branch 'main' into 1bit/852-share-path-not-clock with parents
a6f10006a + 692cfa25c, and the PR's own change is byte-identical at both heads —
git rev-parse 88f1475d6:tests/hybrid_kvshare_route.sh = pr858:tests/hybrid_kvshare_route.sh = f32f3421b691…, own
diff tests/hybrid_kvshare_route.sh +3/-2 either way.
Re-ran the gate rather than carrying it, with the two fake helpers extracted from this head as well (tests/fake_backend.py,
tests/fake_kvshare_provider.py; a first attempt with only the test file failed "backend 0 did not become ready", which was
my scratch dir, not the PR):
ok serve starts with the shared route on ok serve starts with a provider that refuses the protocol
ok the reply comes through ok the reply still comes through
ok the request was pinned to slot 0 ok the fallback is named once
ok the handoff ran (share + adopt, not the file route) ok no share/adopt line was reported
ok no fallback happened
ok the provider got one readable fd per region
ok the socket is gone from the slot directory
PASS (11/11)
CI at 40fd4cdd9: build success, CodeQL + Analyze x4 success, pr_agent success, hw_gate skipped.
|
Persistent review updated to latest commit d547e5e |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
At d547e5eb4 (merge of 7e64bbd2b into 40fd4cdd9), superseding my line at 40fd4cdd9. The branch's own change is
still the single 3-line edit to tests/hybrid_kvshare_route.sh (blob f32f3421b691… at every head since 88f1475d6),
and I re-ran that script at 40fd4cdd9 with the two fake helpers from the same head: 11/11 PASS. CI at
d547e5eb4: build success.
|
Persistent review updated to latest commit 5fafff7 |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY
At 5fafff7e0 (merge of 5f816a989 into d547e5eb4), superseding my line at d547e5eb4. Own file
tests/hybrid_kvshare_route.sh is blob-identical to the head I ran (f32f3421b691…), own diff still +3/−2, and that
script gave 11/11 PASS at 40fd4cdd9 with the two fake helpers from the same head. CI at 5fafff7e0: build success
(02:26Z).
|
Independent confirmation that this is the right fix, from CI rather than from a stub: #859's run just failed on the exact
Run: https://github.com/1bit-MONSTER/engine/actions/runs/41565718288 (branch Nothing changes about my READY at |
Fixes #852.
tests/hybrid_kvshare_route.sh:62asserts "the handoff ran (share + adopt, not the file route)" withgrep -q "hybrid: .* share 0\.[0-9]* ms, first byte", butapp/serve.cpp:2087logs that duration with%.3f:So the check only passes when the share took less than a millisecond, which is a statement about the box's load,
not about the path.
The same regex is also a weaker negative arm
:76reuses it as! grep -q ...for "no share/adopt line was reported". There it fails the other way: a log thatdid carry
share 3.900 msdoes not match, so the negated grep succeeds and the check reports a clean log. Both sitesnow match the path and any duration.
Evidence — real engine path, not a synthetic log
Reproduced on the box with the engine's own hybrid route (CPU, fake provider, no device,
--llama-serverpointed at thetest's own backend with a 5 ms delay in its
?action=sharehandler, which is what system load does to that handoffnaturally):
share 5.929 ms, first byte 33 ms:62:62:76(negated)Regex arms over the reported values, both directions:
:62:62:76:76share 0.412 msshare 3.900 msWhat I did not change
minimal fix is to stop asserting a clock in a check about the path, so the number is gone rather than re-tuned.
A latency row, if wanted, belongs beside the numbers on an idle box (~0.1–0.4 ms) and needs its own control.
origin/mainscript — the share was sub-millisecond on an idle box, which is exactly why this flake is intermittentand why the failure above needed a loaded share to appear.
shellcheck -S warningreports one pre-existingSC2034at:74(replyunused); unchanged here.bash -nclean. One file, +3/−2.