scarlett: keep refusal reasons for cached refusals #129
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/brcly--TuxBox!129
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/129/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@absceptual on GitHub · 2026-11-25 00:38 UTC · original
absceptual:scarlett/cached-refusal-reasons→main· +138 −17 · 9 files · 1 commits · merged 2026-11-25 00:39 UTCAn
.unsupportedmarker holds only the request key. Once a refusal is cached, every later preparation reports it ascached_reason_unavailable, so a warm run cannot rank its refusals. In #39, the 3,966 preparation refusals in a tester's log could not be ranked for this reason, and the tester was asked to run a separate emitter pass withtools/triage_scarlett_shaders.pyinstead.This change keeps the reason with the marker:
compile_requestwrites the emitter's last stderr line to<key>.reason, capped at 512 bytes, and then publishes the marker. xshader prints the refusal as that last line.compile_requestreads<key>.reasonwithout following links and raisesShaderRefused(reason, cached=True, remembered=True).refusal_bucketand the top-ten reason list in preparation use it like a fresh refusal..unsupportedmarker still contains exactly the key, so the D3D12 provider'scached_refusalcheck is unchanged.cached_reason_unavailable.normalize_refusalandrefusal_detaileach had a copy of the code that strips thexshader failed (65):prefix and takes the last line. Both now callrefusal_lineinshader_diagnostics, which the new code also uses.The reason file stays in the local cache. The aggregate line still prints only fixed bucket labels, and the top-ten list prints normalized reasons as it already did for fresh refusals. docs/PROJECTSCARLETT.md is updated to match.
Tests:
tests/test_refusal_reasons.pychecks that a warm refusal keeps the same bucket as the fresh one without running xshader again, that the marker still holds only the key, that a missing, oversized or symlinked reason file falls back tocached_reason_unavailable, and that a long reason is capped. The expected bucket intest_runtime_shader_linksand the summary text intest_scarlett_prepare updated. On macOS,python -m unittest discover -s tests -qgives the same result asmain(75fdeba): two existing errors, intest_shader_inventoryandtest_prep_jobs_defaults_and_bounds, and 70 Linux-only skips. Withsys.platformforced tolinux,test_runtime_shader_links,test_shader_prep,test_chase_warmup,test_scarlett_prep,test_runtime_shader_workersandtest_dxil_storepass 43 of 44, and the one error (sched_getaffinityin the worker test that counts jobs) also happens onmain. I have not run this on Linux or against recorded ProjectScarlett requests.🤖 Generated with Claude Code