Repository navigation
Description
DONE. Found by the nanopynix port (#97), 2026-09-29.
Decision
Carl, 2026-09-29, from three routes: pin nix::verbosity at CHATTY
once, at import, and patch Nix so RemoteStore::setOptions does not
send the pin to the daemon.
Why
nix::verbosity is a plain global. Every printMsg site reads it on
its own thread, and huggorm's VerbosityDemand writes it whenever a
subscription starts or ends. nanopynix-bindings found that race with
ThreadSanitizer and pins the global instead: one write, before any Nix
thread exists. Its nix_util.cpp measured CHATTY as the widest pin
that costs evaluation, store queries and flake fetches nothing; DEBUG
costs a flake evaluation its RPC deadline.
huggorm did not pin because of the daemon (#95):
setOptions sends the gate at handshake (remote-store.cc:118), the
daemon narrates at that level, and the client re-raises each line as
printError, so it reaches an unsubscribed caller's stderr as an
error. Measured for this task (#97, "The verbosity ceiling"):
query work echoes 0 lines at CHATTY and 32 at DEBUG. Libstore holds 24
sites at TALKATIVE or CHATTY in GC, file transfer, substitution and the
builders, so a CHATTY pin would echo those when the daemon does that
work. The setOptions patch removes that.
Decisions, 2026-09-29
Carl answered both open questions:
- Above the pin: an import-time ceiling, as nanopynix-bindings has.
HUGGORM_LOG_CEILINGat import picks the pin, default CHATTY. A
subscription above it gets nothing above it, andprocess_verbosity
says what the pin is. huggorm's widening test from Correlating a log with the call that caused it #626
becomes "up to the ceiling". - The daemon: the Nix patch makes
setOptionssend a separate,
atomic level, andVerbosityDemandkeeps that at the widest level a
subscription asks for (INFO when none). So a DEBUG subscriber still
gets daemon DEBUG lines, as now, and no pin reaches the daemon.
Open questions for the work, now answered above
- What a subscription above CHATTY gets. With the gate pinned, Nix
drops a DEBUG record before any logger runs. nanopynix-bindings reads
NANOPYNIX_LOG_CEILINGat import for that. huggorm'stest_logs
pins the widening that Correlating a log with the call that caused it #626 added. - What the daemon is told: INFO always, or the widest level a
subscription asks for, which is whatVerbosityDemandgives it now. - nanopynix's huggorm scope needs the Nix patch too, as it has
libstorePatches.
Evidence
nanopynix's test_nix_filters_at_a_pinned_ceiling_that_no_call_moves
fails on huggorm: the ceiling is INFO, and the test expects CHATTY and
no movement.
The work
nix-remote-verbosity.patchaddsstd::atomic<int> nix::remoteVerbosity{-1}to libstore.setOptionssends it when it
is zero or more, andnix::verbosityotherwise, sonixitself
does not change. It is inlibstorePatches, which nanopynix's
huggorm scope already takes.install_log_tapis the one write tonix::verbosity: the value of
log_ceiling(), at import, before any Nix thread exists. It sets
remoteVerbosityto lvlInfo in the same place.log_ceiling()readsHUGGORM_LOG_CEILING: a level name in any
case, or 0 to 7. A value that names no level REFUSES the import.
nanopynix-bindings keeps its default for a bad value instead; that
ignores the caller with nothing said, which is this repository's
named failure mode.VerbosityDemand::reconcilestores intoremoteVerbosity, never
intonix::verbosity. Its floor is lvlInfo, a constant: the old
floor readnix::verbosity, which is now the pin.daemon_verbosity()readsremoteVerbosity. Thetest_logsgates
that watchedprocess_verbosity()move now watch it, and two new
gates pinprocess_verbosity()at CHATTY through subscriptions at
7 and refuse a record above CHATTY to a subscription at 7.
Proved by breaking it
Two rounds, each break restored after (test_logs.py):
log_ceilingdefaulting to VOMIT fails the pin test, the
HUGGORM_LOG_CEILING=""probe, and the test that a subscription at
7 gets nothing above CHATTY.reconcilestartingwidestat VOMIT fails
test_nothing_asks_nix_for_everythingand the four gates that watch
the daemon level go back down.reconcilewritingnix::verbositytoo fails the pin test.install_log_taptelling the daemon VOMIT fails every
HUGGORM_LOG_CEILINGprobe: the daemon starts at 7.
WRONG FIRST: the test that a subscription at 7 gets nothing above
CHATTY evaluated a file, and passed with the ceiling at VOMIT. That
evaluation raises nothing above TALKATIVE, so the test tested
nothing. It now calls builtins.findFile on a fresh search path
element, which Nix narrates with debug() (eval.cc:3285), and the
same break fails it.
nanopynix's test_nix_filters_at_a_pinned_ceiling_that_no_call_moves
passes on the huggorm lane.
Migrated from tasks/102-pin-the-verbosity-gate.md.done.
Assisted-By: Opus 5
Activity