Skip to content

#618: icons::USE_NERD_FONTS is unguarded process-global render state — one future test away from nondeterministic snapshot failures - #644

Merged
JDonaghy merged 1 commit into
developfrom
issue-618-icons-use-nerd-fonts-is-unguarded-proces
Aug 9, 2026
Merged

#618: icons::USE_NERD_FONTS is unguarded process-global render state — one future test away from nondeterministic snapshot failures#644
JDonaghy merged 1 commit into
developfrom
issue-618-icons-use-nerd-fonts-is-unguarded-proces

Conversation

@JDonaghy

@JDonaghy JDonaghy commented Aug 9, 2026

Copy link
Copy Markdown
Owner

Closes #618

Automated PR opened by coordinator for review of issue #618.

…-global

Icon::s()/c() read a process-wide AtomicBool to pick between the nerd
glyph and ASCII fallback, and it's written from several production
paths (tui_main, shell_app, settings :set nerdfonts, gtk). Since Rust's
test harness runs tests concurrently across threads in one process, a
single future test flipping this flag would nondeterministically
corrupt every snapshot test running on another thread at the same
time -- exactly the failure shape #615 turned out not to be, but which
the #615 audit surfaced as a live landmine.

Swap the AtomicBool for a thread_local Cell<bool>. Both backends only
ever set-then-render on their own single thread, so this is behavior-
preserving in production, while making cross-test corruption
structurally impossible: a test that flips the flag can only affect
other tests dispatched to the very same worker thread, never
concurrently-running tests on other threads.

Add regression tests proving the default-true behavior survives the
swap and that setting the flag on one thread is invisible to a
concurrently-running thread.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@JDonaghy
JDonaghy merged commit 509b8fe into develop Aug 9, 2026
1 check passed
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.

icons::USE_NERD_FONTS is unguarded process-global render state — one future test away from nondeterministic snapshot failures

1 participant