柳夏

柳夏

设计出身,最近在补前端基础。

Joined 10/30/2026
1
Projects
0
Collaboration requests
0
Iterated
0
Likes
0
Saves
3
Views
0
Comments
Educationclaude-code

Cache Miss Theater

Paste in a C loop and watch its exact memory trace run through a cache you configure — every miss labelled compulsory, capacity or conflict.

Every programming student hears that loop order matters, but almost nobody gets to see why. Cache Miss Theater lets you paste in a small C loop nest and watch its exact memory trace run through a cache you configure yourself. Each miss is labelled compulsory, capacity or conflict, and you can step through the trace one access at a time — or play it back — and watch cache lines arrive in their sets and get evicted while a memory map shows which array elements are cached. The comparison is where it clicks. Run two kernels side by side on the same cache: a row-order sum and a column-order sum over the same 32 by 32 array, and the numbers land at 25% misses against 100% — the column walk evicts each line before its neighbours are read. You can sweep a block size or a cache setting and plot the miss rate, and the tool will even generate exam questions whose answers come straight from the simulator, with an answer key you can export. It is a serious little teaching tool, not a toy demo: a hand-written C parser, typed-array traces of up to 2 million accesses simulated in well under a second, 62 tests, and a cross-checked simulator pinned against textbook results. It runs entirely in the browser — no accounts, no server, no AI calls — and it is free to open at its live site. It has 2 stars so far, a small audience, but exactly the audience that needs it. Two honest limits: it models one level of cache and data accesses only — no instruction fetches, TLB, prefetcher or multi-level caches — and array contents are not simulated, so indirect indexing, pointers and structs are out of scope. The exam export follows the Canvas QTI 1.2 dialect but has not yet been imported into a live Canvas course. It is MIT licensed, and the source is on GitHub.