chore: capture post-P0/P1 state for clean P2 start (working tree was dirty at task begin)
This commit is contained in:
@@ -76,17 +76,28 @@ func EvictSmallest(v vfs.VFS, bytesNeeded uint) uint {
|
||||
return EvictBySizeAsc(v, bytesNeeded)
|
||||
}
|
||||
|
||||
// EvictLFU performs LFU (Least Frequently Used) eviction
|
||||
// EvictLFU performs LFU (Least Frequently Used) eviction using AccessCount from FileInfo (P1-03 real impl).
|
||||
func EvictLFU(v vfs.VFS, bytesNeeded uint) uint {
|
||||
// For now, fall back to size-based eviction
|
||||
// TODO: Implement proper LFU tracking
|
||||
return EvictBySizeAsc(v, bytesNeeded)
|
||||
switch fs := v.(type) {
|
||||
case *memory.MemoryFS:
|
||||
return fs.EvictLFU(bytesNeeded)
|
||||
case *disk.DiskFS:
|
||||
return fs.EvictLFU(bytesNeeded)
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
// EvictHybrid implements a hybrid eviction strategy
|
||||
// EvictHybrid implements a documented size+recency+frequency hybrid (uses GetTimeDecayedScore; lower=evict first).
|
||||
func EvictHybrid(v vfs.VFS, bytesNeeded uint) uint {
|
||||
// Use LRU as primary strategy, but consider size as tiebreaker
|
||||
return EvictLRU(v, bytesNeeded)
|
||||
switch fs := v.(type) {
|
||||
case *memory.MemoryFS:
|
||||
return fs.EvictHybrid(bytesNeeded)
|
||||
case *disk.DiskFS:
|
||||
return fs.EvictHybrid(bytesNeeded)
|
||||
default:
|
||||
return 0
|
||||
}
|
||||
}
|
||||
|
||||
// GetEvictionFunction returns the eviction function for the given strategy
|
||||
|
||||
Reference in New Issue
Block a user