Source: https://shadowfrag.com/blog/less-work-between-input-and-server/

# Removing work between input and the server

By the SHADOWFRAG developer · Technology · Oct 26, 2026 · 4 min read

I changed storage, network waiting and retry ownership to remove work before messages leave. The measured gains belong to specific 64-client tests, with their failed baseline kept visible.

[Moonspire’s opposing pagodas and connecting routes, captured in the current SHADOWFRAG engine.](https://ds9.dynostatic.com/media.php?id=01M5THGFGWXFWTE34G57BRBM7W&revision=1)

Moonspire’s opposing pagodas and connecting routes, captured in the current SHADOWFRAG engine. Captured 2026-10-25.

After the [earlier delivery investigation](https://shadowfrag.com/blog/keeping-multiplayer-updates-fresh/), I looked at work that was happening before a [packet](https://shadowfrag.com/glossary/#term-network-packet) could leave. An idle [network worker](https://shadowfrag.com/glossary/#term-readiness-wait) was waking repeatedly. Ordinary matches were copying storage sized for many more possible identities. A retry could also create another unsent attempt while the earlier one was still waiting.

These problems needed changes to storage and scheduling as well as to the rules for retrying messages.

## Changing the default transport

New game, Practice and dedicated-server launches now use **[PicoQUIC](https://shadowfrag.com/glossary/#term-picoquic) with [CUBIC](https://shadowfrag.com/glossary/#term-cubic)**. [PicoQUIC](https://shadowfrag.com/glossary/#term-picoquic) is the network [transport](https://shadowfrag.com/glossary/#term-transport-backend) implementation; [CUBIC](https://shadowfrag.com/glossary/#term-cubic) adjusts its sending behavior in response to congestion. [Quiche](https://shadowfrag.com/glossary/#term-quiche) with [CUBIC](https://shadowfrag.com/glossary/#term-cubic) remains available as an alternative.

The choice follows the retained [Highlands](https://shadowfrag.com/glossary/#term-shogun-highlands) comparisons, both direct and with artificial network impairment, and the star-heavy comparisons. It does not establish that one [QUIC](https://shadowfrag.com/glossary/#term-quic) library is faster on every machine or connection. Both still carry SHADOWFRAG's own movement records, [shot references](https://shadowfrag.com/glossary/#term-hit-reference), [delivery receipts](https://shadowfrag.com/glossary/#term-acknowledgement) and [projectile](https://shadowfrag.com/glossary/#term-projectile) events.

The shared message format is **[wire protocol 37](https://shadowfrag.com/glossary/#term-wire-protocol)**, so [client and server](https://shadowfrag.com/glossary/#term-client-server) builds must be compatible. Changing the default did not increase the [player limit](https://shadowfrag.com/glossary/#term-player-cap) or loosen combat timing.

## Growing storage without moving live references

Player and [projectile](https://shadowfrag.com/glossary/#term-projectile) storage now grows in [stable pages](https://shadowfrag.com/glossary/#term-paged-storage) of memory. Ordinary work can follow the state the match actually uses instead of traversing the full range of possible identities. Adding pages preserves existing numeric slots and references. Cleared storage is reset before reuse, and filling a vacant slot does not change the identities of [projectiles](https://shadowfrag.com/glossary/#term-projectile) still alive elsewhere.

Simulation, history, presentation and other readers all depend on that behavior. An early vector, or growable-array, candidate invalidated a reference another part of the code was still using. A deque, a different container arrangement, made a heavy [projectile](https://shadowfrag.com/glossary/#term-projectile) case slower. The retained design addresses those failures and has explicit checks for growth, clearing, copying and high-numbered slots.

## Waiting until there is useful work

The [network worker](https://shadowfrag.com/glossary/#term-readiness-wait) now waits for a socket to become ready, outgoing work to arrive or the next relevant deadline. Linux and Windows use their native waiting mechanisms. An idle worker no longer wakes unconditionally every **100 microseconds**.

When work is available, fresh [scene fragments](https://shadowfrag.com/glossary/#term-frame-fragment), urgent input and results, durable state and cosmetic events get bounded turns. The scheduling has to let the parts of a scene finish arriving while still giving urgent work a turn. Making [queues](https://shadowfrag.com/glossary/#term-queue) larger would not, by itself, solve that problem.

## Giving each retry one owner

For a reliable record awaiting a [delivery receipt](https://shadowfrag.com/glossary/#term-acknowledgement), the application and native [transport](https://shadowfrag.com/glossary/#term-transport-backend) adapter can hold at most one [unsent plaintext attempt](https://shadowfrag.com/glossary/#term-receipt-journal): one unencrypted copy waiting to be passed to [QUIC](https://shadowfrag.com/glossary/#term-quic). A valid [acknowledgement](https://shadowfrag.com/glossary/#term-acknowledgement) cancels that queued attempt. Once a [packet](https://shadowfrag.com/glossary/#term-network-packet) has been handed to [QUIC](https://shadowfrag.com/glossary/#term-quic), it cannot be recalled, so this rule does not promise that only one copy ever appears on the network.

[Projectile](https://shadowfrag.com/glossary/#term-projectile)\-event retries use validated timing replies to estimate when to try again, within fixed bounds. Action and hit-result recovery retains its shorter interval. [Movement deadlines](https://shadowfrag.com/glossary/#term-input-deadline), limits on [historical hit checks](https://shadowfrag.com/glossary/#term-historical-hit-check) and damage validation remain enforced.

The latest capacity work also repaired a stale [input-epoch grant](https://shadowfrag.com/glossary/#term-input-epoch): permission tied to an older generation of input could arrive after newer [authoritative state](https://shadowfrag.com/glossary/#term-authoritative-state). It could then disconnect a client that had otherwise recovered. Correcting that ordering problem did not require relaxing the server's combat checks.

## Reading the comparison with its limits

In the retained **64-client foundation comparisons**, the program generating [synthetic clients](https://shadowfrag.com/glossary/#term-synthetic-protocol-client) used roughly **58–63% less [processor time](https://shadowfrag.com/glossary/#term-cpu)**. The workload with [packet loss](https://shadowfrag.com/glossary/#term-packet-loss) retried about **88% fewer reliable application records**. Its total server send rate changed from about **7.02 to 6.58 [MB/s](https://shadowfrag.com/glossary/#term-data-rate-units)**. The retry count and the total bytes measure different things; an 88% reduction in one did not produce an 88% reduction in the other.

The lossy comparison used an earlier completed baseline with the same plan because a newer baseline failed. That failure remains in the report. Contention inside the [client generator](https://shadowfrag.com/glossary/#term-synthetic-protocol-client) also contributed to the timing changes, so the result is not a forecast for 64 independent players' computers.

Subsequent testing adds more evidence about dense fights, [Highlands](https://shadowfrag.com/glossary/#term-shogun-highlands) and impaired connections. [Read the current capacity results](https://shadowfrag.com/blog/capacity-beyond-64/) and use the [netcode page](https://shadowfrag.com/netcode/) to distinguish this implementation from the earlier byte-level studies.

[Back to blog](https://shadowfrag.com/blog/)[Browse the glossary](https://shadowfrag.com/glossary/)

## Request an _invite code._

SHADOWFRAG is opening by invitation. Request a code and receive development updates. [Shadow Council](https://shadowfrag.com/glossary/#term-shadow-council) contributors receive priority when invitations begin.

Enable JavaScript to request an invite code and confirm your email address.

Email confirmation required. Codes will be issued later; a request does not guarantee access. Unsubscribe at any time. [Privacy](https://shadowfrag.com/privacy/)

Confirm your email to join the invitation list. Codes will be issued in a future round; a request does not guarantee access. Unsubscribe at any time.

Anyone can request a code. For [Shadow Council](https://shadowfrag.com/shadow-council/) priority, introduce yourself on Discord with your role, experience, region and time zone. Include examples of your maps or content if you have them.

[Join Discord](https://discord.gg/EHj7rZDNj)
