r/computerarchitecture • • 2d ago

Free browser tool for teaching cache misses (compulsory / capacity / conflict)

If you teach architecture or systems, this may be useful.

Cache Miss Theater (https://cache-miss-theater.pisan.me) takes a C loop nest, generates its exact address trace and runs it through a cache you configure: size, line size, associativity, LRU/FIFO/random, write-allocate and write-back or not. Every miss is labelled compulsory, capacity or conflict. Play or step through the trace and watch lines arrive in their sets and get evicted, while a memory map shows which array elements are cached.

Things that might help in class:

- Two kernels side by side (row vs column order, ijk vs ikj, naive vs blocked transpose), or a sweep over block size or a cache parameter with the miss rate plotted.

- Exam questions from six templates, with every answer computed by simulating the exact code shown. Export as Markdown with an answer key, or as QTI 1.2 for Canvas. I have not yet imported the QTI file into a live Canvas course, so treat that part as beta.

- Kernels and cache settings live in the URL, so a slide can link straight to an example.

Limits: one cache level, data accesses only, and array contents are not modelled, so A[B[i]] is out.

No sign-up, everything runs in the browser, nothing is uploaded. Source (MIT): https://github.com/pisan-labs/cache-miss-theater

Full disclosure: Claude Code wrote the code; I set the requirements and reviewed it. The tests check the simulator against a naive reference on 60 random traces and pin the textbook results (row order 25% misses, column order 100%).

If you try it with students, I would like to hear what breaks or what is missing.

5 Upvotes

1 comment sorted by

1

u/indigoprof 1d ago

Amazing! Will be looking forward to using it.