FFFF bindings: per-evaluator verbosity, now that the level is thread-local · Issue #97 · nixidae/nixidae · GitHub
[go: up one dir, main page]

Skip to content

bindings: per-evaluator verbosity, now that the level is thread-local #97

Closed

Description

@Lillecarl

Why

The pin of nix::verbosity (#63) moved the filter into a thread-local inside
PyLogger, and moved the authority over the level into Python. The dispatch
wrapper applies the level per operation, in inproc._impl._run_with_log_context
and in rpc.worker._state.run_request.

That mechanism already gives a level per operation. What it does not yet give
is a level per evaluator, because every EvalSession reads its Session's
level:

@property
def _level(self) -> int:
    """The level this evaluator's operations log at.

    The session's, because verbosity is one setting with two doors ...
    """
    return int(self._session._level)

What blocks it

protocols.py documents verbosity as one process-wide setting with two
doors
, and tests/nanopynix/test_verbosity.py pins that contract on both
engines: a write through an EvalSession must be visible through its
Session. Per-evaluator verbosity rewrites that contract and the tests that
hold it.

#92 kept the contract deliberately, so that the race fix could be reviewed on
its own. This issue is the other half.

Scope

  • Give EvalSession a level of its own, and fall back to the session's level
    when the caller never set one.
  • Rewrite the "two doors" prose in protocols.py to say what the scope now
    is.
  • Update the tests that hold the old contract, rather than deleting them.

Acceptance criteria

  • A test proves two evaluators can hold different verbosities at once, and
    that each one sees only its own events. (This criterion comes from bindings: pin nix::verbosity and filter per thread, to fix a data race and get per-evaluator verbosity #92,
    which cannot satisfy it without this change.)
  • Both engines behave the same way, on local and on daemon.
  • The soak roster keeps working: a test that writes a shared session's level
    is denylisted in tests/support/soak.py, and per-evaluator levels should
    let some of those entries go away. Remove the ones that it does.

Refs #92

Activity

  1. Lillecarl commented on Aug 5, 2026

    @Lillecarl
    ContributorAuthor

    Inherited the sixth acceptance criterion of #92, which closed today.

    A test proves two evaluators hold different verbosities at once.

    That criterion belongs here and not there. It asks for per-evaluator
    verbosity, which rewrites the contract that protocols.py documents and that
    test_verbosity_is_one_process_wide_setting_with_two_doors pins: verbosity
    is one process-wide setting with two doors. #92 kept that contract on purpose,
    so that a race fix stayed reviewable on its own.

    The mechanism this needs is already in place. nix_util.cpp holds the level
    in a thread_local, default_verbosity is the atomic that a thread Nix
    starts for itself reads, and both engines already save, set and restore the
    level around each dispatched operation. What is missing is the authority
    question: which object owns the level, and what a write through one door does
    to the other.

  2. added
    source: nanopynix
    on 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: nanopynix

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0