Flexible Stream Control and CPU Sleep in Memora8

As the Memora8 architecture and the Reganta operating system evolved, we validated two important extensions to the execution model:

  1. the ability to change the width of the hardware SmallFIFO queue;
  2. the ability to put a processor to sleep for an arbitrary number of clock cycles.

These were not introduced as narrow optimizations for one algorithm. They are architectural changes to how Memora8 handles processors, memory, and data streams.

Adaptive SmallFIFO Width

Originally, the hardware SmallFIFO queue used a fixed exchange width. That was simple to implement, but it limited efficiency across different workload shapes.

In real computation streams, transferred data sizes can vary significantly. Small control messages and large data blocks have very different throughput requirements.

After adding the ability to change SmallFIFO width, the system could adapt the communication channel to the current stream of data.

On the BLAKE3 control scenario, this reduced exchange overhead and improved long-running data-processing throughput.

For an input size of 8192 KB:

  • execution time decreased from 510.005 s to 501.591 s;
  • processor cycles decreased from 534 million to 513 million;
  • IPC increased from 4.649 to 4.775.

The digest remained unchanged. For every input size, all versions of the system produced the same digest.

This means the SmallFIFO change was not just a queue-interface tweak. It became a mechanism for adapting hardware exchange to the structure of the computation stream.

Arbitrary CPU Sleep Duration

The second change concerns the waiting model.

Previously, when a processor had no work to do, it actively polled the event state. That approach is easy to implement, but it wastes instructions that do not contribute useful computation.

In the new model, a processor can enter sleep state for a specified number of cycles.

Waiting is now part of the execution architecture:

  • the processor does not perform continuous polling;
  • the Kernel determines when the processor wakes up;
  • execution continues after the required event occurs.

On the BLAKE3 control scenario after introducing fixed sleep:

  • instruction count for 8192 KB decreased by about 1.5%;
  • branch bubbles decreased by about 3%;
  • execution time decreased from 501.591 s to 482.985 s relative to the previous version.

On small workloads, the effect is even more visible because a larger share of the previous work was spent on waiting:

  • for 8 KB, instruction count decreased by more than 4%;
  • branch bubbles decreased by more than 8%.

Benchmark Data

The control runs preserve functional correctness. The digest for each input size remained identical across all versions of the system.

Summary of the key comparison

Metric 20 Jul → 25-1 (SmallFIFO) 25-1 → 25-2 (fixed sleep)
8 KB runtime 0.911 → 0.937 s (+2.9%) 0.937 → 0.854 s (-8.9%)
8 KB cycles 2,145,977 → 2,138,575 (-0.35%) 2,138,575 → 2,138,592 (+0.00%)
8 KB instructions 3,749,864 → 3,734,307 (-0.42%) 3,734,307 → 3,565,716 (-4.51%)
8 KB IPC 1.747 → 1.746 1.746 → 1.667
8 KB branch bubbles 538,862 → 531,964 (-1.28%) 531,964 → 487,676 (-8.33%)
8192 KB runtime 510.005 → 501.591 s (-1.65%) 501.591 → 482.985 s (-3.71%)
8192 KB cycles 534,106,223 → 513,562,855 (-3.85%) 513,562,855 → 514,918,425 (+0.26%)
8192 KB instructions 2,483,144,031 → 2,452,507,601 (-1.23%) 2,452,507,601 → 2,415,378,301 (-1.51%)
8192 KB IPC 4.649 → 4.775 4.775 → 4.691
8192 KB branch bubbles 263,702,226 → 256,564,168 (-2.71%) 256,564,168 → 248,797,724 (-3.03%)

Phase 1: SmallFIFO Width Change

Between 2026-07-20 and 2026-07-25-1, the width change produced a stable gain on medium and large workloads.

  • for 8192 KB, runtime fell by 8.414 s and cycles dropped by 20.54 million;
  • for 4096 KB, runtime decreased from 256.153 s to 250.504 s (-2.21%), and cycles dropped from 267.925 million to 257.669 million (-3.83%);
  • for 2048 KB, runtime fell from 138.916 s to 124.613 s (-10.30%);
  • for 512 KB, runtime fell from 39.804 s to 31.789 s (-20.14%);
  • for 8 KB, cycle count decreased by 0.35%, but wall-clock time increased by 2.9%, which suggests measurement noise or fixed overhead sensitivity in tiny runs.

Instruction count improved as well, though less strongly than cycles. IPC increased on large inputs, for example from 4.649 to 4.775 at 8192 KB. This matches the reduction in overhead and bubbles caused by the previous queue width.

Total stalls and Load hazards remained essentially unchanged for 8 KB, so the main effect was not the elimination of load hazards.

Phase 2: Fixed-Tick CPU Sleep

The transition from 2026-07-25-1 to 2026-07-25-2 did not materially change the cycle budget on large runs, but it removed useless work.

  • 8192 KB: instructions -1.51%, branch bubbles -3.03%, runtime -3.71%;
  • 4096 KB: instructions -1.52%, branch bubbles -3.04%, runtime -3.41%;
  • 1024 KB: instructions -1.54%, branch bubbles -3.09%, runtime -3.85%;
  • 8 KB: instructions -4.51%, branch bubbles -8.33%, runtime -8.86%, with cycles almost unchanged.

The strongest signal is in control-flow counters:

  • for 8 KB, Branch taken dropped from 107,616 to 83,508 (-22.4%);
  • for 8 KB, Branch bubbles dropped from 531,964 to 487,676 (-8.3%);
  • for 8192 KB, Branch taken dropped from 27,486,878 to 22,927,644 (-16.6%);
  • for 8192 KB, Branch bubbles dropped from 256,564,168 to 248,797,724 (-3.0%).

This is consistent with removing busy polling of the event pool. The CPU no longer spins in a check loop when there is no event; instead, it wakes according to the fixed tick schedule.

The lower IPC in this phase does not indicate a weaker compute core. The ratio changes because the instruction stream contains fewer waiting instructions.

Full Output Matrix

Below are the measured deviations for all recorded input sizes.

The percentage deltas are relative to the 2026-07-20 baseline. IPC is shown as an absolute difference.

Size 07-25-1 vs 07-20: time cycles instructions IPC bubbles 07-25-2 vs 07-20: time cycles instructions IPC bubbles
8 +2.85% -0.34% -0.41% -0.001 -1.28% -6.26% -0.34% -4.91% -0.080 -9.50%
16 -1.38% -1.27% -0.81% +0.011 -1.86% -6.91% -1.21% -3.83% -0.067 -7.82%
24 -3.91% -1.99% -0.98% +0.032 -2.17% -8.03% -1.82% -3.30% -0.048 -6.84%
32 -2.69% -2.67% -1.09% +0.061 -2.39% -5.99% -2.49% -3.02% -0.020 -6.27%
40 -3.16% -3.23% -1.15% +0.090 -2.54% -6.33% -2.96% -2.82% +0.006 -5.84%
48 -6.00% -3.73% -1.20% +0.122 -2.65% -6.29% -3.50% -2.69% +0.039 -5.58%
56 -2.85% -2.41% -1.05% +0.049 -2.32% -5.87% -2.28% -3.16% -0.031 -6.63%
64 +1.29% -2.76% -1.11% +0.063 -2.44% -5.90% -2.61% -3.06% -0.018 -6.37%
128 -2.31% -3.50% -1.20% +0.105 -2.62% -6.24% -3.26% -2.80% +0.021 -5.82%
256 -2.79% -3.51% -1.20% +0.105 -2.63% -6.91% -3.29% -2.81% +0.021 -5.84%
512 -20.14% -3.76% -1.22% +0.121 -2.69% -24.53% -3.51% -2.75% +0.036 -5.69%
1024 -2.14% -3.77% -1.23% +0.121 -2.69% -5.90% -3.52% -2.75% +0.036 -5.70%
2048 -10.30% -3.84% -1.23% +0.125 -2.70% -12.98% -3.58% -2.73% +0.040 -5.66%
4096 -2.21% -3.83% -1.23% +0.125 -2.70% -5.54% -3.58% -2.73% +0.040 -5.66%
8192 -1.65% -3.85% -1.23% +0.126 -2.71% -5.30% -3.59% -2.73% +0.042 -5.65%

The minus sign means the metric decreased. Time has two visible outliers: 512 KB after the SmallFIFO change (-20.14%) and 64 KB in the intermediate comparison (+1.29% on the first phase). These should be treated separately from the general trend in cycles and instruction count.

For reference, the absolute values of the same runs are preserved below.

Size 2026-07-20 2026-07-25-1 2026-07-25-2
8 0.911 s; 2,145,977; 3,749,864; 1.747; 538,862 0.937 s; 2,138,575; 3,734,307; 1.746; 531,964 0.854 s; 2,138,592; 3,565,716; 1.667; 487,676
16 1.375 s; 2,338,532; 5,904,010; 2.525; 738,160 1.356 s; 2,308,948; 5,856,286; 2.536; 724,418 1.280 s; 2,310,244; 5,677,670; 2.458; 680,444
24 1.869 s; 2,532,982; 8,059,097; 3.182; 938,418 1.796 s; 2,482,658; 7,980,426; 3.214; 918,054 1.719 s; 2,486,870; 7,793,094; 3.134; 874,274
32 2.271 s; 2,726,938; 10,213,178; 3.745; 1,139,194 2.210 s; 2,654,002; 10,101,982; 3.806; 1,111,914 2.135 s; 2,659,019; 9,904,659; 3.725; 1,067,812
40 2.686 s; 2,921,229; 12,367,078; 4.234; 1,340,492 2.601 s; 2,826,922; 12,224,400; 4.324; 1,306,494 2.516 s; 2,834,721; 12,018,849; 4.240; 1,262,156
48 3.084 s; 3,118,704; 14,523,305; 4.657; 1,542,646 2.899 s; 3,002,319; 14,348,554; 4.779; 1,501,814 2.890 s; 3,009,701; 14,132,432; 4.696; 1,456,640
56 3.853 s; 5,242,081; 18,253,769; 3.482; 2,077,018 3.743 s; 5,115,676; 18,061,255; 3.531; 2,028,876 3.627 s; 5,122,573; 17,676,334; 3.451; 1,939,376
64 4.354 s; 5,456,650; 20,443,934; 3.747; 2,281,734 4.410 s; 5,306,152; 20,216,236; 3.810; 2,226,078 4.097 s; 5,314,208; 19,819,248; 3.729; 2,136,432
128 8.139 s; 8,965,439; 39,295,137; 4.383; 4,226,496 7.951 s; 8,651,692; 38,824,838; 4.488; 4,115,560 7.631 s; 8,672,878; 38,192,958; 4.404; 3,980,576
256 16.321 s; 17,936,380; 78,610,248; 4.383; 8,456,670 15.865 s; 17,307,265; 77,666,895; 4.488; 8,234,156 15.193 s; 17,346,603; 76,399,987; 4.404; 7,962,624
512 39.804 s; 33,935,728; 155,637,264; 4.586; 16,577,698 31.789 s; 32,659,514; 153,731,204; 4.707; 16,132,264 30.042 s; 32,746,080; 151,362,446; 4.622; 15,634,066
1024 63.595 s; 67,903,349; 311,317,301; 4.585; 33,162,666 62.237 s; 65,341,367; 307,495,683; 4.706; 32,269,966 59.841 s; 65,515,404; 302,758,484; 4.621; 31,272,544
2048 138.916 s; 133,914,738; 621,090,578; 4.638; 65,995,554 124.613 s; 128,778,566; 613,432,900; 4.763; 64,210,612 120.887 s; 129,127,198; 604,117,698; 4.678; 62,259,676
4096 256.153 s; 267,924,829; 1,242,279,341; 4.637; 132,006,426 250.504 s; 257,669,456; 1,226,977,096; 4.762; 128,438,626 241.961 s; 258,338,204; 1,208,323,938; 4.677; 124,531,874
8192 510.005 s; 534,106,223; 2,483,144,031; 4.649; 263,702,226 501.591 s; 513,562,855; 2,452,507,601; 4.775; 256,564,168 482.985 s; 514,918,425; 2,415,378,301; 4.691; 248,797,724

Functional Correctness

Across all three series and for every identical input size:

  • the same digest was printed for that size;
  • the run scheme stayed the same (modules.pages + mmu_windows);
  • the configuration remained 8 CPUs and 1024 KB SRAM;
  • the number of pages depends on input size and is not constant:
    • for 8 KB the allocation is SRAM=18, DRAM=1, RAW=1;
    • for 16 KB it is 19, 2, 2;
    • for 24–64 KB it is respectively 20–25, 2, 3–8;
    • for 128 KB it is 29, 2, 16;
    • for 256–8192 KB, SRAM stays 29, DRAM stays 2, and RAW grows as 32, 64, 128, 256, 512, 1024.

For any fixed input size, all three control versions report the same page counts. Pages change across input sizes, but not between versions for the same size.

No functional regression was found. Digests intentionally differ between input sizes.

Analysis Limits

The logs are preserved, but there is no separate source-code snapshot or configuration snapshot for each date. Therefore, the causal link to SmallFIFO and fixed sleep is taken from the control-point description and supported by the counter behavior.

For stricter attribution, it would be useful to also store:

  • the commit SHA;
  • SmallFIFO parameters;
  • sleep tick length;
  • sleep/wake/event-pool polling counters.

Conclusion

  1. Changing SmallFIFO width produced the main performance gain for long BLAKE3 runs: up to about 3.8% fewer cycles and about 2.2% less wall-clock time at 4096 KB, with a stronger effect on some sizes.
  2. Fixed-tick CPU sleep produced an additional reduction in runtime of about 3–4% on large inputs and up to 8.9% on 8 KB, mainly by removing useless event-pool polling and the associated instructions and branch bubbles.
  3. The final version 2026-07-25-2 is faster than the original baseline on every large control size; at 8192 KB the runtime improved from 510.005 s to 482.985 s (-5.30%).
  4. The digest did not change, so the optimizations preserved the computational result.

AI Summary

  • Subject: Memora8 execution-model extensions
  • Topics: adaptive SmallFIFO width, programmable CPU sleep, event-pool polling removal
  • Workload: BLAKE3 control runs
  • Main outcome: lower overhead, better throughput, unchanged digest
  • Largest reported gain: 8192 KB runtime improved from 510.005 s to 482.985 s
  • AI-relevant keywords: Memora8, Reganta, SmallFIFO, CPU sleep, BLAKE3, event polling, branch bubbles, stream control