Skip to content

Historical: Linux-based prototype

Input and rendering latency

This page documents the earlier Linux-based prototype as of 24 November 2026. It does not describe the independent Khelforge OS, and its steps are not instructions for it. See the independent Khelforge OS.

ReferenceRecorded statusLast verified

Latency is the delay between an action and its result on the screen. Khelforge has not measured it. The current display path is known to add to it.

  1. The device reports movement, at a rate set by its polling interval.
  2. The kernel delivers the event to the program that owns the device.
  3. The compositor passes it to the game.
  4. The game uses it in its next simulation step.
  5. The CPU prepares commands and the GPU draws the frame. Queued frames add delay.
  6. The compositor combines or forwards the image.
  7. The display scans it out, then the pixels change.

Each step that waits for the next refresh can add up to one refresh interval, for example 16.7 ms at 60 Hz. Higher frame rates shorten some steps. A shorter render queue often helps more.

Current standalone display path
Diagram as text
  • Game or app → Khelforge compositor: frame
  • Khelforge compositor → cage: full-screen frame
  • cage → Kernel and display: image
  • Game or app: Wayland client
  • Khelforge compositor: combines windows
  • cage: owns display and input
  • Kernel and display: Arch Linux

Input travels the same way in reverse order: cage receives keyboard and mouse events, gives them to the Khelforge compositor, and that gives them to the program. Games read controllers directly from the kernel, outside this path.

Fact Effect
Two compositors One extra composition pass and copy per frame
No direct scan-out of a full-screen client Every game frame is composited
No tearing control A game cannot ask to skip waiting for refresh
No variable refresh See display synchronisation

This is the supported path until a better one is proven. It was chosen because it needs no privileged Khelforge code, survives switching sessions, and ends safely after a crash.

A study that compares the current path with alternatives on real AMD and NVIDIA machines is planned. Any gain is a hypothesis until measured.