fix(validation): directional gating for copycat detection#65
Conversation
- Replace symmetric `flagged.update((a, b))` with `_attribute_pair_direction` that uses S3 LastModified to identify the later uploader (copier) and flag only the copier; abstain when direction is unresolved. - Bundle per-miner copycat state in `MinerCopycatSubmission` so `detect_cheaters` takes one argument per miner instead of parallel digest/upload parameters.
…bution - CopycatTracker now remembers per-miner S3 LastModified across the whole submission interval, so interval-scope directional attribution survives a victim going offline mid-interval (caught by two independent reviewers). - Add regression tests for the victim-offline scenario and for the reset_interval clearing the archived timestamps.
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
WalkthroughThis PR refactors the copycat detection pipeline to incorporate S3 upload timestamp attribution. It introduces Changes
Sequence Diagram(s)sequenceDiagram
participant Sampler as MinerSampler
participant Service as CopycatService
participant Processor as WindowProcessor
participant Copycat as CopycatTracker
participant S3 as S3 API
Sampler->>S3: Check active miners
S3-->>Sampler: active_hotkeys, upload_times (LastModified)
Sampler-->>Service: (active_hotkeys, upload_times)
Service->>Processor: process_window(uploads_by_hotkey=upload_times)
Processor->>Processor: Validate miners<br/>Collect digest_counters<br/>total_rollouts
Processor->>Processor: Construct MinerCopycatSubmission<br/>Join with upload_times
Processor->>Copycat: detect_cheaters(submissions)
Copycat->>Copycat: _attribute_pair_direction<br/>(Compare S3 timestamps)
Copycat->>Copycat: Gate only resolved copier<br/>Log unresolved cases
Copycat-->>Processor: CopycatViolation<br/>(copier, victim, resolved)
Processor-->>Service: WindowResults
Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Possibly related PRs
Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
LastModifiedto identify the later uploader as the copier; abstains when unresolvedTest plan
basilica-grail-validatorwith live log verificationSummary by CodeRabbit
Release Notes
New Features
Improvements
Tests