mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4043
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2434
Author: @MrKop-git
Created: 10/14/2026
Status: ❌ Closed
Base:
main← Head:pr/kv-stream-policy-bench📝 Commits (2)
9973139tools: the KV streaming page-pool policy bench - the resolve kernel's CLOCK against LRFU, LRU and Belady (#2415)624c05etools: the policy bench's trace loader takes variable-k records, the shape --dump-kv-select writes📊 Changes
3 files changed (+476 additions, -0 deletions)
View changed files
📝
docs/DETAILS.md(+4 -0)➕
tools/replay_kv_stream_policy.py(+349 -0)➕
tools/test_replay_kv_stream_policy.py(+123 -0)📄 Description
Summary
The measurement-first half of #2415:
tools/replay_kv_stream_policy.pyreplays KV block selections through the streaming page pool's policies offline and reports misses, hit rate and the bytes re-read over the compulsory load - the same split #1089 reports for the expert cache.int32 layer, int32 k, k block ids, k float32 weightsper resolve call - the--dump-routingrecord layout, so an engine-side--dump-kv-select(the follow-up this PR does not add) can write the same shape.resolve_kernelat slot granularity: reference on use and load, a second-chance sweep from a hand, a slot this call uses never taken, and the kernel's3*nscan limit on overflow (OVERFLOW (too few resident cells)).KS = lambda*KS + gain): the hit range is the top--top-fracweight mass of a call with ties at the cut included, decayed every--decay-everycalls (ActKV decays per compression step, kvmem per request - the cadence is a knob because the right one here is what the sweep finds). LRU and Belady are the recency baseline and the offline ceiling.What it changes and what it leaves alone
Two
tools/files and one docs line in DETAILS.md. The engine and every answer are untouched - no flag, no kernel, no default.How it was checked
python -m unittest tools.test_replay_kv_stream_policy- 9 tests, no GPU, no model pack:What the patterns say so far (seed 42, one layer; the parameters are in each line):
scan(400 calls, width 100, 1024 slots)spotty(2000 calls, hot 32 every other call, 8 one-offs, 48 slots)loop(1000 calls, window 64 over 400 blocks, 128 slots)intermittent(1000 calls, hot 32 every call, cold 48 every 8th, 64 slots)agent(2000 calls, tail 96 + task 96 + 16 one-offs, 128 slots)So: LRFU is never worse than CLOCK in these patterns and closes its one gap (spotty); the case for making it the default needs real selection traces - which is #2415's engine-side dump follow-up.
Not tested
Real selection traces (no engine dump exists yet), multi-layer interleavings beyond the
--layersround-robin, weight-driven hit ranges as the indexer produces them (the synthetic patterns use equal weights), and any link between these miss counts and wall time on a card.🤖 Generated with Claude Code
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.