Skip to content

rex3_jit: let a shader rejected by a full compile queue be requested again - #106

Merged
techomancer merged 1 commit into
techomancer:mainfrom
iblowmymind:rex3-jit-queue-retry
Sep 14, 2026
Merged

techomancer merged 1 commit into
techomancer:mainfrom
iblowmymind:rex3-jit-queue-retry

Conversation

@iblowmymind

@iblowmymind iblowmymind commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Problem

RexJit::request_compile inserts the shader key into queued, then sends it on a compile channel that holds 256 requests. When try_send failed on a full channel, the key stayed in queued. Every later draw with that shader saw a phantom queued entry and never asked for compilation again, so the shader ran on the interpreter for the rest of the session.

It's easy to hit at startup: the persistent warm-up profile queues every recorded shader at once. A 263-entry profile reproduced it, and in the graphics unit tests it showed up as 30-second JIT compile timed out failures.

Change

  • src/rex3_jit/mod.rs: if try_send fails, remove the key from queued so a later draw can request it again.
  • Unit tests: they no longer load the user's persistent warm-up profile (~/.iris) under cfg(test), so their results don't depend on the machine they run on.

Tests

New full_compile_queue_allows_retry saturates a one-slot channel, checks that the rejected request is not left queued, then drains the channel and checks that the retry is accepted. It does this without starting the real compiler thread.

cargo test --release --features rex-jit --lib -- rex3

Note: rules/testing/rex-jit-queue-retry.md.

…again

The compile channel holds 256 requests. When try_send failed, the shader key
stayed in `queued`, so every later draw saw a phantom queued entry and never
requested compilation again — the shader stayed on the interpreter for the
rest of the session. A 263-entry warm-up profile reproduced it, as 30-second
compile timeouts in the graphics tests. Rejected keys are now removed so a
later draw retries.

Unit tests no longer load the user's persistent REX warm-up profile, so they
don't depend on ~/.iris state. full_compile_queue_allows_retry checks
saturation and retry without starting the real compiler.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_019t4zZR7XH1DeuPZbVooWNS
@techomancer
techomancer merged commit f8fb34e into techomancer:main Sep 14, 2026
1 check passed
@iblowmymind
iblowmymind deleted the rex3-jit-queue-retry branch September 14, 2026 14:22
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