Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
8ba826d
fix(skippy): default BUILTIN_UBATCH to 512 to clear the CUDA SSM SSD …
Sep 9, 2026
7af1fac
evals: add KV restart replay harness for #1647
Sep 9, 2026
fac7bd2
evals: address review on KV restart replay harness
Sep 9, 2026
cb871b4
Spread concurrent new sessions with local route reservations (#1631)
michaelneale Sep 10, 2026
f52ba5d
fix(evals): make restart replay cohorts valid
Sep 10, 2026
4e93457
fix(skippy): preserve resident KV fast path with L3
Sep 9, 2026
e43f42e
fix(skippy): prefer longer durable restore
Sep 10, 2026
c9bb7c7
fix(skippy): preserve durable restart checkpoints
Sep 9, 2026
25cdc0a
chore(ci): refresh console print ratchet
Sep 9, 2026
e03de61
perf(skippy): stream packed restore into payload
Sep 9, 2026
cf35b63
perf(skippy-cache): hash payload during packed restore
Sep 10, 2026
114ab68
Report accurate parameter sizes for local GGUF models (#1742)
i386 Sep 10, 2026
2080997
fix(certification): use served package ref for runtime smoke gates (#…
ndizazzo Sep 10, 2026
efd7ab6
fix(system): correct day/month transposition in macOS ps lstart parsi…
ndizazzo Sep 10, 2026
6ac879f
feat(skippy-cache): benefit-per-exclusive-byte admission policy (1650…
Sep 10, 2026
7247a39
perf(skippy-server): prewarm generation graph before readiness
Sep 10, 2026
28d10f0
fix(skippy-cache): address #1747 review blockers (hard capacity, dedu…
Sep 10, 2026
1e270df
fix(skippy-cache): fix leftover config reference in probation cap test
Sep 10, 2026
4000212
fix(skippy-cache): address round-2 policy-contract blockers on #1747
Sep 10, 2026
ff3e0c7
fix(skippy-cache): address round-3 policy-contract blockers on #1747
Sep 10, 2026
48c25ad
fix(skippy-cache): clippy -D warnings clean; clock_debug is test-only
Sep 10, 2026
59e0498
fix(skippy-cache): cap selection simulates removals; dedup segment re…
Sep 10, 2026
da03480
fix(skippy-cache): actually land the scratch-ledger cap selection (ro…
Sep 10, 2026
ecedd2f
fix(skippy-cache): prevalidate segment conflicts before any admission…
Sep 10, 2026
0a59cfc
fix(skippy-cache): structural prevalidation precedes clock/expiry; re…
Sep 10, 2026
daf63be
fix(skippy-cache): cap repair covers hit probationers and removal-dri…
Sep 10, 2026
3362b3f
fix(skippy-cache): remove_without_cap_repair is test-only
Sep 10, 2026
79d6bf2
fix(skippy-cache): thread pins/holds through probation cap selection
Sep 10, 2026
79d24f7
fix(skippy-cache): pin-aware signatures are the public store-facing APIs
Sep 10, 2026
8cc50b0
fix(ui): use advertised capacity for node and mesh VRAM totals (#1746)
ndizazzo Sep 10, 2026
a219ee0
fix(skippy-cache): misses age grace, persist-only write accounting, r…
Sep 10, 2026
cc2db25
fix(skippy-cache): one-shot acceptance gate requires strict improvement
Sep 10, 2026
69a2fd4
fix(skippy-cache): persisted bytes use resident size; grace regressio…
Sep 10, 2026
680efa5
fix(skippy-cache): retain acceptance evidence without console output
Sep 10, 2026
911d56f
v0.76.0: prepare release source
github-actions[bot] Sep 10, 2026
fc29974
fix(ci): simplify llama canary state machine (#1727)
i386 Sep 10, 2026
4fce94c
test(model-hf): make the read-only filesystem warning test portable
Virgile-pct Sep 4, 2026
065490f
feat(mesh): itemize the advertised capacity behind vram_bytes (#1673)
Virgile-pct Sep 10, 2026
1ff184c
feat(system): gpu_name_source beside gpu_name (#1679)
StevenMih Sep 10, 2026
e540e71
fix: serialize materialized cache writes on Windows
Bortlesboat Sep 8, 2026
dc3ecf6
fix: use served model IDs in ready commands
Bortlesboat Sep 8, 2026
6c097d6
test(ci): guard product smoke selector drift
ndizazzo Sep 9, 2026
0520150
ci: preflight packaging dispatch credentials
ndizazzo Sep 9, 2026
2877ac7
ci: publish SDK smoke cache policy
ndizazzo Sep 9, 2026
1a2545d
fix: retain device placement in native log summaries
Bortlesboat Sep 8, 2026
0bda645
ci: stop duplicate release tag runs (#1731)
ndizazzo Sep 10, 2026
9f4b3ea
Merge remote-tracking branch 'origin/main' into sync-tmp-1736
Sep 10, 2026
aec8c50
fix(gpu-tune): preserve throughput profile ubatch
Sep 11, 2026
640f19b
fix(skippy-cache): close remaining policy review gaps
Sep 11, 2026
3354456
ci: sync protected SDK cache policy
Sep 12, 2026
3fc2723
ci: sync protected SDK cache policy
Sep 12, 2026
7e7a675
chore(skippy): restack durable L3 on #1707
Sep 12, 2026
6f10192
chore(skippy): consolidate durable L3 review
Sep 12, 2026
ab24050
chore(skippy): validate consolidated durable L3
Sep 12, 2026
1414471
ci: synchronize conventional commit validator
Sep 12, 2026
f8637d3
fix(skippy): address consolidated L3 review findings
Sep 12, 2026
13b2773
Merge remote-tracking branch 'origin/scama/skippy-l3-streaming-restor…
Sep 12, 2026
312b176
chore(ci): retrigger consolidated L3 validation
Sep 12, 2026
1a08512
Merge remote-tracking branch 'origin/scama/skippy-l3-streaming-restor…
Sep 12, 2026
15aa711
test(mesh): align review regressions with runtime contracts
Sep 12, 2026
44e3e63
Merge remote-tracking branch 'origin/scama/skippy-l3-streaming-restor…
Sep 12, 2026
65ff632
Merge remote-tracking branch 'origin/scama/skippy-l3-streaming-restor…
i386 Sep 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/skippy-cache/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pub mod identity;
pub mod l3;
pub mod manager;
pub mod payload;
pub mod policy;
pub mod radix;
pub mod resident;
pub mod source;
Expand Down
121 changes: 121 additions & 0 deletions crates/skippy-cache/src/policy/accounting.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
//! Shared-segment accounting: fractional credit so physical bytes are never
//! double-counted across entries (#1650 first slice).

use std::collections::{BTreeMap, BTreeSet};

use crate::policy::EntryKey;

/// Opaque shared-segment identity.
pub type SegmentId = u64;

/// Ledger of shared physical segments and their referencing entries.
///
/// A segment referenced by N entries contributes `size / N` bytes to each
/// entry's effective footprint; releasing an entry drops its reference, and a
/// segment with no references disappears entirely.
#[derive(Debug, Default, Clone)]
pub struct SharedSegmentLedger {
segments: BTreeMap<SegmentId, SegmentRecord>,
}

#[derive(Debug, Clone, PartialEq)]
pub struct SegmentRecord {
pub size: u64,
pub references: BTreeSet<EntryKey>,
}

impl SharedSegmentLedger {
/// Register a segment of `size` bytes referenced by `entry`. Adding the
/// same reference twice is a no-op.
pub fn add(&mut self, segment: SegmentId, size: u64, entry: EntryKey) {
let record = self.segments.entry(segment).or_insert(SegmentRecord {
size,
references: BTreeSet::new(),
});
record.references.insert(entry);
}

/// Release `entry`'s reference to `segment`; drop the segment when the
/// last reference goes.
pub fn release(&mut self, segments: &[SegmentId], entry: EntryKey) {
for segment in segments {
if let Some(record) = self.segments.get_mut(segment) {
record.references.remove(&entry);
if record.references.is_empty() {
self.segments.remove(segment);
}
}
}
}

/// Fractional bytes charged to `entry` for its shared segments.
pub fn fractional_bytes(&self, entry: EntryKey, segments: &[SegmentId]) -> f64 {
segments
.iter()
.filter_map(|s| self.segments.get(s))
.filter(|r| r.references.contains(&entry))
.map(|r| r.size as f64 / r.references.len() as f64)
.sum()
}

/// Read access for marginal-release computation.
pub fn segment_record(&self, segment: SegmentId) -> Option<&SegmentRecord> {
self.segments.get(&segment)
}

/// Physical bytes that would actually be released if `entry` were
/// removed: its exclusive bytes are caller-side, so this covers only
/// segments where this entry holds the last reference — the marginal
/// physical release, not the fractional credit.
pub fn marginal_physical_bytes(&self, entry: EntryKey, segments: &[SegmentId]) -> u64 {
segments
.iter()
.filter_map(|s| self.segments.get(s))
.filter(|r| r.references.len() == 1 && r.references.contains(&entry))
.map(|r| r.size)
.sum()
}

/// Total physical bytes held in the ledger.
pub fn total_bytes(&self) -> u64 {
self.segments.values().map(|r| r.size).sum()
}

pub fn segment_count(&self) -> usize {
self.segments.len()
}
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn fractional_credit_splits_bytes_without_double_counting() {
let mut ledger = SharedSegmentLedger::default();
ledger.add(1, 300, 10);
ledger.add(1, 300, 11);
ledger.add(1, 300, 12);
assert_eq!(ledger.total_bytes(), 300);
for entry in [10u64, 11, 12] {
assert_eq!(ledger.fractional_bytes(entry, &[1]), 100.0);
}
}

#[test]
fn releasing_last_reference_drops_segment() {
let mut ledger = SharedSegmentLedger::default();
ledger.add(7, 128, 1);
ledger.release(&[7], 1);
assert_eq!(ledger.total_bytes(), 0);
assert_eq!(ledger.segment_count(), 0);
}

#[test]
fn duplicate_reference_is_idempotent() {
let mut ledger = SharedSegmentLedger::default();
ledger.add(7, 128, 1);
ledger.add(7, 128, 1);
assert_eq!(ledger.fractional_bytes(1, &[7]), 128.0);
}
}
Loading
Loading