You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bindings: per-evaluator verbosity, now that the level is thread-local #97
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:
@propertydef_level(self) ->int:
"""The level this evaluator's operations log at. The session's, because verbosity is one setting with two doors ... """returnint(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.
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.
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.
Activity
fix(bindings): pin nix::verbosity, and filter the log per thread
fix(bindings): pin nix::verbosity, and filter the log per thread
Lillecarl commentedon Aug 5, 2026
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.pydocuments and thattest_verbosity_is_one_process_wide_setting_with_two_doorspins: verbosityis 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.cppholds the levelin a
thread_local,default_verbosityis the atomic that a thread Nixstarts 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.
feat(verbosity): give each evaluator a log level of its own
docs(verbosity): say what an evaluator's level covers, and what it do…
fix(bindings): pin nix::verbosity, and filter the log per thread
feat(verbosity): give each evaluator a log level of its own
docs(verbosity): say what an evaluator's level covers, and what it do…