Uniformiser la lecture des atomiques dans Sink : .load()/.store() explicites #25
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.40) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.40 · 302 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.342
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #25"
general
weight: 0.35
ambroise-leclerc
Summary
Sink(include/mddlog/sinks/Sink.cppm) storedminLevel/enabledasstd::atomicbut accessed them through the implicit conversion /operator=inshouldLog(),getMinLevel(),isEnabled(),setMinLevel(),setEnabled(), whilecore::SimpleLogger's equivalent members already went through explicit.load()/.store().Closes #22.
One correction to the ticket's own audit
#22 said Logger's writes were "plain assignment in both classes, only the reads differ" - that turned out to be wrong once I actually checked:
SimpleLogger::setEnabled/setMinLevelalready use.store(), not=. Since the ticket's stated goal is to alignSinkwith Logger's actual convention, I fixed the two writes inSinkas well (setMinLevel,setEnabled), not just the three reads originally listed. Same reasoning as the reads: behaviorally identical, but the explicit call makes the atomic access visible at the call site.Verification
std::atomicunderinclude/:Logger's own members, andLogStatistics's five counters inLogRecord.cppm(used fromSink.cppm,RecordingSink.hpp,SinkFailureSpec.cpp,basic_usage.cpp) all already go through.load()/.store()/.fetch_add()/.exchange().Sink.cppm'sminLevel/enabledwere the only gap.CONTRIBUTING.md(new "Atomics" subsection).ninja-gcc(gcc 16.1.0): build succeeds, 28/28 SpecLab scenarios pass, unchanged expectations.clang-format-21; idempotent (--dry-run --Werrorclean on a second pass).Test plan
git grepfinds no remaining implicit-conversion read of astd::atomic<...>member underinclude/.cmake --preset ninja-gcc/ctest --preset ninja-gcc --output-on-failure: build succeeds, 28/28 pass.clang-format-21 --dry-run --Werror: idempotent.<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
Documentation
Added contributor guidance recommending explicit atomic operations when reading or updating atomic values, making these accesses clearer in code.
Maintenance
Updated logging settings to use explicit atomic reads and writes. Logging behavior remains unchanged.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->