rex3_jit: let a shader rejected by a full compile queue be requested again - #106
Merged
Merged
Conversation
…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
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.
Problem
RexJit::request_compileinserts the shader key intoqueued, then sends it on a compile channel that holds 256 requests. Whentry_sendfailed on a full channel, the key stayed inqueued. 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 outfailures.Change
src/rex3_jit/mod.rs: iftry_sendfails, remove the key fromqueuedso a later draw can request it again.~/.iris) undercfg(test), so their results don't depend on the machine they run on.Tests
New
full_compile_queue_allows_retrysaturates 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.Note:
rules/testing/rex-jit-queue-retry.md.