Skip to content

tests: pre-translate the tb in arm_movr12_hang - #2385

Open
retrocpugeek wants to merge 1 commit into
unicorn-engine:devfrom
retrocpugeek:fix/movr12-hang-flake
Open

tests: pre-translate the tb in arm_movr12_hang#2385
retrocpugeek wants to merge 1 commit into
unicorn-engine:devfrom
retrocpugeek:fix/movr12-hang-flake

Conversation

@retrocpugeek

@retrocpugeek retrocpugeek commented Aug 11, 2026

Copy link
Copy Markdown

Fixes the intermittent arm_movr12_hang failure on the macos-14 - x86_64 wheel job (#2383). The 500us timeout bounded TCG code generation as well as execution, and cold codegen is most of that window.

Pre-translate the block with uc_ctl_request_cache so the timeout bounds execution only. A pre-built tb does not carry the until exit, so the block now ends in svc and a UC_HOOK_INTR hook stops emulation in-band.

The timeout is also raised to 10ms to cover the risk of a scheduler preemption stalling the thread mid-window. Load is not required for this: the worst off-CPU stall measured on an idle 16-core box was 627 µs, already past the old 500 µs bound, and it reaches tens of ms under contention.

Measured under 2x CPU oversubscription, 1000 runs each: 2.50% failures before, 0% after.

Approach suggested by @PhilippTakacs in #2383.

The 500us timeout covered code generation as well as execution, so the
test flaked on the macos-14 x86_64 wheel job. Pre-build the tb and raise
the timeout to 10ms to absorb scheduler stalls; a pre-built tb drops the
`until` exit, so svc plus an intr hook stops emulation in-band instead.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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