Skip to content
Tactiverge

Mission Labs / ML-002 · CLOCK THIEF

Mission 002The Computer That Wastes Time

Right answers, wrong amount of time.

A tiny processor gets every multiplication right and still misses its deadline. Find where the clocks go.

A processor chip with an hourglass at its centre. Clock ticks spill out of one side and a square-wave clock signal runs along the bottom.

Technical briefing

A small controller built on Bench-8, the Silicon Studio's 8-bit teaching processor, multiplies sensor values by adding over and over. It is never wrong. It is just slow.

Inspect the program, profile where the clocks go, remove waste, then change the algorithm itself. At higher levels the same program runs on a pipelined processor and behind a tiny cache, and the speed-up has to be measured, not assumed.

Engineering objectiveMake the multiply routine measurably faster on the stated workload while every answer stays correct.

Systems in play

  • Silicon Studio · Bench-8 assembler and cycle stepper
  • Silicon Studio · 5-stage pipeline scheduler
  • Silicon Studio · cache simulator
  • Simulation OS · Pipeline throughput (journal snapshot at levels 4–5)

No new physics: every number comes from an existing, tested Tactiverge model. These are simplified educational models, not engineering-grade tools.

Five levels, five different questions

  1. Level 1 · ExplorerCause and effect: which instructions cost time?Keep every answer correct and make the whole workload at least 1.25× faster than the starting program.
  2. Level 2 · BuilderRules and debugging: tidy the loop without breaking it.Correct on every case and at least 1.45× faster than the starting program.
  3. Level 3 · InnovatorIntegration to a specification: change the algorithm, not just the instructions.Correct on every case, at least 1.7× faster, and the program (code + data) no larger than 80 bytes.
  4. Level 4 · Systems EngineerDynamics and trade-offs: the same program on a pipelined processor.Correct on every case, pipelined workload at least 1.55× faster than the starting program, and at most 110 clocks lost to branch flushes.
  5. Level 5 · Research EngineerEvidence under uncertainty: a speed-up depends on the workload.Correct on every trial; mean speed-up at least 1.55×; even the worst trial at least 1.3×; mean data-cache hit rate at least 0.8.

Mission console

Choose a level, change the design, run seeded trials and read the automatic feedback. Your design and notes stay on this device unless you save them to your Journal.

Bringing the mission console online…

More than one way to win

These approaches all have honest costs. They describe ideas, not answers: the numbers are yours to find, and the model checks them.

  • Remove dead instructions

    Delete instructions whose results are never used and reads of values already held in the accumulator.

    Gains

    • Safe and easy to check
    • Smaller program

    Costs

    • Limited gain: the loop still runs once per addition

    Useful at levels 1, 2, 4, 5

  • Tighten the loop body

    Count down by subtracting the constant straight from memory and drop the spare variable, so each pass does only what it must.

    Gains

    • Fewer clocks on every pass, for every input
    • Lower memory traffic and a better cache hit rate

    Costs

    • The loop still runs as many times as before

    Useful at levels 1, 2, 4, 5

  • Loop over the smaller number

    Compare the two inputs first and let the loop count down whichever is smaller.

    Gains

    • Huge gains on lopsided inputs
    • Fewer taken branches

    Costs

    • Extra code and a temporary variable
    • Little gain when the inputs are similar

    Useful at levels 1, 2, 3, 4, 5

  • Do more work per pass

    Put two additions in each pass of the loop, checking for the end between them, so the jump back happens half as often.

    Gains

    • Halves the branch flushes on a pipeline

    Costs

    • Larger program
    • Small gain on the multi-cycle machine

    Useful at levels 4, 5

  • Combine an algorithm change with a tidy loop

    Loop over the smaller number and keep the loop body tight.

    Gains

    • Largest speed-up on most workloads

    Costs

    • More code to verify
    • Few accesses make the cache hit rate look worse

    Useful at levels 3, 4, 5

Assumptions and limits

Knowing what the model leaves out is part of the mission.

  • Bench-8 is an invented teaching processor; its clocks are conceptual, with no real clock period or memory latency.
  • The pipeline model assumes one clock per stage, predict-not-taken branches resolved in EX, and no structural hazards.
  • The data cache is a 4-line conceptual model with reads and writes treated alike; instruction fetches are not cached.

Go deeper

Content status: technically checked (automated tests run every level's starting design, which must fail, and at least two different approaches, which must pass). Written with AI assistance; not yet reviewed by an educator. Simulation only: never connected to physical hardware.