Repository navigation
#641: the Linux engine's drag-tail live tests run main's checks unchanged, up to 3 times, logging each failed attempt (test-only) - #646
Merged
Conversation
…0 ms span before the release Three tests took "the tail" to be whatever the drag source read in the 20 ms before the release. The tail is 8 ms, a visit, 8 ms, a visit, 8 ms, then the release. A loaded machine stretches those rests, so the first visit falls outside the span. The engine still sent every visit; its record says motions 4. - a_chrome_handle_s_end_with_a_drop_under_way_gets_the_tail_and_off_gives_the_old_end (#640's run: 2 of the 4 pairs, the last at 11.46 ms; 3 of 300 runs here under stress-ng). It now reads the tail from its first step, x 61, which the path and the end's revisit never reach. - on_xtest_routes_each_tail_visit_steps_forward_and_back_and_shows_nothing_behind_the_end: the tail is read from the first step forward of the end. - a_chrome_drop_whose_path_outlasts_its_floor_..._inside_its_floor, through source_before_release: it now gives the last three motions the source read, the tail's two and the one before them, oldest first. "Two in the last 20 ms" becomes "the last two, each a rest after the one before it". The in-floor case of that last test is also timed to the millisecond on the engine's own clock: released 350 to 351 ms after the take, no visit dropped, and 6 to 20 ms after the last motion. A loaded machine wakes the engine or the source late. That shows in the engine's record (past the floor, or a visit dropped) or in the source's reads (6 of 60 runs here failed one of those bounds). Such an attempt now runs again, up to 3 times, as the visit-dropped cases in this file already do. The last attempt is held to every bound, so a release that is always late still fails. What each test asserts is unchanged. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…n a loaded machine holds that poll up 200 runs of the first commit under stress-ng: the order-based tails passed every time (the handle test always got its four pairs). Four runs still failed. The cause was the source's own reads: its 1 ms poll was held up, so it read a visit late and a rest measured short. The visits were 5.3 ms apart instead of 8 in the handle test and on the background route, and the release came 3.2 ms after the last motion on the dedicated route. The engine's record showed it on time. The handle test's cases and the outlasting path's routes now run again, up to 3 times, when a rest or a gap reads outside its bound, as the in-floor case already does. The last attempt is held to every bound. Structural checks (the places, the counts in the engine's record, the route) are still checked on every attempt. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
After d67c6b6, one run in 217 under stress-ng failed the in-floor case. Its three attempts were each disturbed: off woke late twice (354 and 364 ms after the take), then the tail's first visit was read 5.4 ms before its second. When off and the tail shared an attempt, a late off cost the tail an attempt too. They now run again apart, each up to 3 times, and each final attempt is held to its bounds. The tail's bounds include being within a millisecond of off's release. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…oundary, and every rest has a ceiling The review found four regressions that the new selection rules let through. Each now fails: 1. Inside the floor, a visit recorded as sent that never arrived. Two spaced path motions and one visit passed every spacing check. floor_visits now reads from the path's arrival at its end, which a path reaches once, on its last sample. After it, there must be exactly the record's keepalives and two visits, all at the end. When the engine records both visits as sent, that count is asserted on every attempt. Only a visit the engine itself dropped can send the attempt round again. 2. On XTEST, a malformed first visit before the first good step. xtest_tail reads from the path's arrival, not from the step's place: only the end and the step after it, the step at least once, the end last. The handle's tail is read the same way (handle_visits): the end's revisits, then exactly the two visits. 3. A handle's visits 80 ms further apart. Each rest now has a ceiling, REST_READ_MAX (20 ms). It is the release rest's existing bound in these tests: the 8 ms rest plus room for a wakeup or a 1 ms poll that a loaded machine holds up. The in-floor visits share it. 4. Off, a stray step before the end's revisit. off_sequence (the end last, no step) runs on every attempt, before the rests decide whether to run again. the_tail_checks_refuse_the_review_s_traces checks each helper against the review's traces and against traces it must accept. The rules as 9fb56bd had them passed all four traces; I checked that in a scratch test, not committed. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
… record, not its first arrival at the end On this Xvfb, the short path reaches its end on two samples, about 42 and 33 ms before the release. So "after the path's first arrival" counted one path motion as a keepalive, and every run failed. The boundary is now the path's last step as the engine records it: release_after_take_ms minus last_step_after_take_ms, on its own clock. It is found among the motions by their own times. On the background route that is the time the engine stamped each motion with as it sent it (Session::now), which the source's held-up reads do not move; the source now keeps those times in AFTER_TAKE_STAMPS. After the boundary there must be exactly the record's keepalives and two visits at the end. The rests are still measured on the source's reads. The trace test takes the review's trace by stamps, plus a path that reaches its end twice. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
…g 1394) Every rewrite of how the three tail tests select the tail turned out weaker than main's checks somewhere, or wrong about the engine. So they are gone: the order-based selection, AFTER_TAKE_STAMPS, REST_READ_MAX, floor_visits, xtest_tail, handle_visits and the trace test. The three tests now run main's bodies verbatim, the 20 ms window included, inside passes_in_one_of: - each attempt runs every one of main's checks; - the test passes when one attempt passes them all, up to TAIL_ATTEMPTS = 3; - a fault the engine repeats fails all three. Ignoring indentation, the change against main is that wrapper and one expression rustfmt split over three lines. Each attempt starts clean, as main's body does: a fresh display, the path set again, and a drag source of its own. A failed attempt's dropped Sender stops its source's loop. Before a retry, the failed attempt's assertion (its message, with the values it judged) is written to stderr past libtest's capture, so CI's log shows an intermittent fault even when a later attempt passes. Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
SSFSKIM
enabled auto-merge (squash)
December 1, 2026 07:35
SSFSKIM
added a commit
that referenced
this pull request
Dec 1, 2026
Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)
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.
Closes #641
On #640's run 46469837347, engine-linux failed
a_chrome_handle_s_end_with_a_drop_under_way_gets_the_tail_and_off_gives_the_old_end:it got 2 of the 4 expected
(61,20)/(60,20)pairs, the last at 11.46 ms before the release. The cause is in thetest, not the engine. This PR changes
native/linux-engine/tests/live_device.rsonly, so there's no version bump.Cause
At a drag's end, the tail is 8 ms, a visit, 8 ms, a visit, 8 ms, then the release. The tail tests judge it by what
the drag source read in the 20 ms before the release, timed by when the source read each event. A loaded machine
stretches those rests, and it can hold up the source's 1 ms poll. When it does, the first visit falls outside the
window, or a rest misses one of its millisecond bounds.
The engine sent all four motions every time. Its record (
release_sync.motions == 4) passed in every failure, andreading the same runs without the window showed all four pairs.
Fix: retries around main's unchanged checks
The three tail tests keep main's selection and assertions exactly as written, the 20 ms window included:
a_chrome_handle_s_end_with_a_drop_under_way_gets_the_tail_and_off_gives_the_old_enda_chrome_drop_whose_path_outlasts_its_floor_ends_on_the_tail_and_a_short_one_on_the_tail_inside_its_flooron_xtest_routes_each_tail_visit_steps_forward_and_back_and_shows_nothing_behind_the_endEach body now runs inside
passes_in_one_of(TAIL_ATTEMPTS, …):TAIL_ATTEMPTS= 3 failed attempts, the last attempt's failure is the test's. A fault the engine repeatsfails all three, so the tests catch what main's catch.
failed attempt's dropped Sender ends its source's loop.
libtest's capture. An intermittent fault therefore shows in CI's log even when a later attempt passes.
Ignoring indentation, the diff against main is that wrapper and one expression rustfmt split over three lines.
Evidence
Runs on an 8-vCPU KVM guest under
stress-ng --cpu 8, on a private Xvfb inside a dbus session, one test thread,without
--nocapture, as engine-linux runs them.What the 22 failed attempts tripped, each one of main's own checks:
One run of the path test passed on its third attempt; no run failed all three. Main's per-attempt failure rates under this load are about 1.5% for the
handle and about 9% for the outlasting path. With 3 attempts, the expected failure rate is about 1 in 300,000 runs for
the handle and about 1 in 1,400 for the path (0.09³). That makes a failure in 200 loaded runs about a 1-in-7 chance,
and none of the 200 runs here hit one.
ci-gate at ab7e891: GREEN (plugin, test-1, test-2, engine-linux), https://github.com/SSFSKIM/cua/actions/runs/46592199750
Sminos-Session: linux171#3c5ca588 (cua on dc-linux171-1e68)