Skip to content

engine: test whether many small dispatch cuts add up on the VM #604

Closed as not planned

Description

@bpowers

Proposal: treat small branch- and dispatch-count reductions in the VM loop that each measure as noise as a bundle, on the theory that together they might push the dispatch jump's branch history under the CPU predictor's capacity and give a larger, non-linear speedup.

Status

The bundle has effectively been tried.
The superinstruction family listed under "R3. Faster dispatch" in docs/design/engine-performance.md landed many such reductions together: retired instructions fell about 28% on C-LEARN and 34% on WORLD3, but branch misses moved far less than branches (-2.6% against -6.3% in one measurement).
The removed dispatches were the easy-to-predict ones, so no threshold effect appeared.
Removing bounds checks, the other candidate, needs unsafe (the engine crate denies it) and measured as zero gain on its own.

The remaining lever for mispredicts is a different dispatch mechanism (#601).

Pointers

Activity

  1. added
    enhancement
    engine
    on May 21, 2026
  2. changed the title [-]engine: bundle marginal branch/dispatch reductions to test for a CPU predictor threshold[/-] [+]engine: test whether many small dispatch cuts add up on the VM[/+] on Oct 12, 2026
  3. added
    wontfix
    on Oct 12, 2026
  4. bpowers commented on Oct 12, 2026

    @bpowers
    OwnerAuthor

    Closing as won't fix.

    Effectively tested: the landed superinstruction family cut instructions ~28% but branch misses only ~2.6% with no threshold effect (engine-performance.md R3); the remaining lever is #601.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineenhancementwontfix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions