8000 Pin the verbosity gate, and tell the daemon something else · Issue #639 · nixidae/nixidae · GitHub
[go: up one dir, main page]

Skip to content

Pin the verbosity gate, and tell the daemon something else #639

Closed

Description

@Lillecarl

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_CEILING at import picks the pin, default CHATTY. A
    subscription above it gets nothing above it, and process_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 setOptions send a separate,
    atomic level, and VerbosityDemand keeps 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_CEILING at import for that. huggorm's test_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 what VerbosityDemand gives 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.patch adds std::atomic<int> nix::remoteVerbosity{-1} to libstore. setOptions sends it when it
    is zero or more, and nix::verbosity otherwise, so nix itself
    does not change. It is in libstorePatches, which nanopynix's
    huggorm scope already takes.
  • install_log_tap is the one write to nix::verbosity: the value of
    log_ceiling(), at import, before any Nix thread exists. It sets
    remoteVerbosity to lvlInfo in the same place.
  • log_ceiling() reads HUGGORM_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::reconcile stores into remoteVerbosity, never
    into nix::verbosity. Its floor is lvlInfo, a constant: the old
    floor read nix::verbosity, which is now the pin.
  • daemon_verbosity() reads remoteVerbosity. The test_logs gates
    that watched process_verbosity() move now watch it, and two new
    gates pin process_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_ceiling defaulting to VOMIT fails the pin test, the
    HUGGORM_LOG_CEILING="" probe, and the test that a subscription at
    7 gets nothing above CHATTY.
  • reconcile starting widest at VOMIT fails
    test_nothing_asks_nix_for_everything and the four gates that watch
    the daemon level go back down.
  • reconcile writing nix::verbosity too fails the pin test.
  • install_log_tap telling the daemon VOMIT fails every
    HUGGORM_LOG_CEILING probe: 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

  1. added
    source: huggorm
    on Oct 19, 2026
  2. transferred this issue fromnixidae/huggormon Oct 19, 2026
  3. added theissue type on Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    source: huggorm

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0