Skip to content

xtask: wait for the stdin echo instead of a fixed delay#2558

Open
stlankes wants to merge 1 commit into
hermit-os:mainfrom
stlankes:stdin-flake
Open

xtask: wait for the stdin echo instead of a fixed delay#2558
stlankes wants to merge 1 commit into
hermit-os:mainfrom
stlankes:stdin-flake

Conversation

@stlankes

@stlankes stlankes commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

test_stdin fed each message to the guest with a one-second pause and then terminated QEMU immediately, reading the echoed output only afterwards. On a slow target the last echo had not been written yet when QEMU was killed, so the collected output ended mid-line and the assertion failed intermittently. This showed up on aarch64_be, which is emulated without hardware acceleration.

Collect the guest's stdout on a background thread and wait until every message has been echoed (bounded by a 60 s timeout) before terminating QEMU. The check no longer depends on the guest keeping pace with a fixed schedule.

test_stdin fed each message to the guest with a one-second pause and
then terminated QEMU immediately, reading the echoed output only
afterwards. On a slow target the last echo had not been written yet
when QEMU was killed, so the collected output ended mid-line and the
assertion failed intermittently. This showed up on aarch64_be, which
is emulated without hardware acceleration.

Collect the guest's stdout on a background thread and wait until every
message has been echoed (bounded by a 60 s timeout) before terminating
QEMU. The check no longer depends on the guest keeping pace with a
fixed schedule.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Benchmark Results

Details
Benchmark Current: 2e47df2 Previous: 2e23902 Performance Ratio
startup_benchmark Build Time 84.02 s 80.34 s 1.05
startup_benchmark File Size 0.80 MB 0.80 MB 1
Startup Time - 1 core 0.74 s (±0.02 s) 0.75 s (±0.02 s) 1.00
Startup Time - 2 cores 0.74 s (±0.02 s) 0.74 s (±0.02 s) 1.00
Startup Time - 4 cores 0.76 s (±0.02 s) 0.74 s (±0.02 s) 1.02
multithreaded_benchmark Build Time 82.74 s 82.11 s 1.01
multithreaded_benchmark File Size 0.86 MB 0.86 MB 1.00
Multithreaded Pi Efficiency - 2 Threads 86.11 % (±6.21 %) 85.89 % (±6.61 %) 1.00
Multithreaded Pi Efficiency - 4 Threads 43.27 % (±2.85 %) 43.43 % (±2.56 %) 1.00
Multithreaded Pi Efficiency - 8 Threads 25.23 % (±1.64 %) 25.76 % (±1.53 %) 0.98
micro_benchmarks Build Time 83.01 s 80.40 s 1.03
micro_benchmarks File Size 0.86 MB 0.86 MB 1
Scheduling time - 1 thread 63.08 ticks (±2.71 ticks) 62.65 ticks (±4.06 ticks) 1.01
Scheduling time - 2 threads 35.13 ticks (±4.67 ticks) 34.08 ticks (±4.10 ticks) 1.03
Micro - Time for syscall (getpid) 3.23 ticks (±0.44 ticks) 3.45 ticks (±0.58 ticks) 0.94
Memcpy speed - (built_in) block size 4096 79862.47 MByte/s (±55309.85 MByte/s) 82448.38 MByte/s (±56997.13 MByte/s) 0.97
Memcpy speed - (built_in) block size 1048576 30514.62 MByte/s (±24654.34 MByte/s) 30585.98 MByte/s (±24707.84 MByte/s) 1.00
Memcpy speed - (built_in) block size 16777216 25841.48 MByte/s (±21394.19 MByte/s) 26340.06 MByte/s (±21720.96 MByte/s) 0.98
Memset speed - (built_in) block size 4096 79708.52 MByte/s (±55200.43 MByte/s) 82292.76 MByte/s (±56891.50 MByte/s) 0.97
Memset speed - (built_in) block size 1048576 31261.86 MByte/s (±25087.35 MByte/s) 31323.85 MByte/s (±25145.86 MByte/s) 1.00
Memset speed - (built_in) block size 16777216 26562.34 MByte/s (±21845.04 MByte/s) 27104.68 MByte/s (±22209.94 MByte/s) 0.98
Memcpy speed - (rust) block size 4096 73365.46 MByte/s (±51321.77 MByte/s) 74097.96 MByte/s (±51811.44 MByte/s) 0.99
Memcpy speed - (rust) block size 1048576 30354.41 MByte/s (±24671.83 MByte/s) 30361.60 MByte/s (±24602.37 MByte/s) 1.00
Memcpy speed - (rust) block size 16777216 26213.43 MByte/s (±21555.49 MByte/s) 27625.34 MByte/s (±22806.88 MByte/s) 0.95
Memset speed - (rust) block size 4096 73816.26 MByte/s (±51650.77 MByte/s) 74373.47 MByte/s (±51976.48 MByte/s) 0.99
Memset speed - (rust) block size 1048576 31094.07 MByte/s (±25098.93 MByte/s) 31110.89 MByte/s (±25033.24 MByte/s) 1.00
Memset speed - (rust) block size 16777216 26967.38 MByte/s (±22038.46 MByte/s) 28386.93 MByte/s (±23265.03 MByte/s) 0.95
alloc_benchmarks Build Time 80.58 s 74.76 s 1.08
alloc_benchmarks File Size 0.87 MB 0.87 MB 1.00
Allocations - Allocation success 91.31 % 91.31 % 1
Allocations - Deallocation success 100.00 % 100.00 % 1
Allocations - Pre-fail Allocations 61.44 % 61.44 % 1
Allocations - Average Allocation time 7842.45 Ticks (±462.89 Ticks) 5860.58 Ticks (±98.43 Ticks) 1.34
Allocations - Average Allocation time (no fail) 8351.30 Ticks (±393.67 Ticks) 6554.81 Ticks (±92.86 Ticks) 1.27
Allocations - Average Deallocation time 1428.52 Ticks (±333.49 Ticks) 1805.01 Ticks (±250.35 Ticks) 0.79
mutex_benchmark Build Time 78.05 s 79.82 s 0.98
mutex_benchmark File Size 0.86 MB 0.86 MB 1.00
Mutex Stress Test Average Time per Iteration - 1 Threads 12.14 ns (±0.45 ns) 12.10 ns (±0.41 ns) 1.00
Mutex Stress Test Average Time per Iteration - 2 Threads 41.58 ns (±2.64 ns) 40.26 ns (±1.68 ns) 1.03

This comment was automatically generated by workflow using github-action-benchmark.

@mkroening mkroening left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stlankes

Copy link
Copy Markdown
Contributor Author

If remember correctly, this issue was fixed by 2f10654

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.

2 participants