Skip to content

libs/hash: async_heavy_test's responsive check ordered through a latch, never through the scheduler - #42

Merged
pinhopro merged 1 commit into
mainfrom
fix/async-heavy-flake
Nov 20, 2026
Merged

pinhopro merged 1 commit into
mainfrom
fix/async-heavy-flake

Conversation

@pinhopro

Copy link
Copy Markdown
Contributor

Bumps libs/hash to webcpporg/hash#8 (fix/async-heavy-flake).

CI run 44690351573 failed msvc-14.3: hash/async_heavy_no_exceptions: run with async_heavy_test.cpp(898): test 'timer_fired_first' failed in function check_responsive. The check raced a 10 ms timer on the caller's io_context against an Argon2id of 64 MiB on the pool; when the caller's thread was descheduled for longer than the derivation, Windows's scheduler (IOCP) ran the already queued completion before the expired timer. A 500 ms delay between the call and run() reproduces it on the local msvc-lane every time.

The work now runs on a test backend, latched, that derives with libsodium and then holds its completion until the timer's handler lets it, so the timer always fires while the work is in flight and the order no longer depends on the scheduler; the result is still compared with the synchronous function's. With the same injected delay, async_heavy and async_heavy_no_exceptions pass on MSVC 14.3 under Wine and natively. macOS full lint is clean.

🤖 Generated with Claude Code

…sive check orders the timer before the completion through a latch

CI run 44690351573 failed async_heavy_no_exceptions on MSVC 14.3 (timer_fired_first):
check_responsive raced a 10 ms timer on the caller's io_context against an Argon2id of
64 MiB on the pool, and when the caller's thread was descheduled for longer than the
derivation, Windows's scheduler ran the queued completion before the expired timer. The
work now runs on a test backend that holds its completion until the timer's handler lets
it, so the order no longer depends on the scheduler.
@pinhopro
pinhopro force-pushed the fix/async-heavy-flake branch from 2ae4b25 to 0569f64 Compare November 20, 2026 10:29
@pinhopro
pinhopro merged commit a8e4403 into main Nov 20, 2026
7 of 185 checks passed
@pinhopro
pinhopro deleted the fix/async-heavy-flake branch November 20, 2026 11:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant