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.
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.
General background
Section titled “General background”- The device reports movement, at a rate set by its polling interval.
- The kernel delivers the event to the program that owns the device.
- The compositor passes it to the game.
- The game uses it in its next simulation step.
- The CPU prepares commands and the GPU draws the frame. Queued frames add delay.
- The compositor combines or forwards the image.
- 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.
What Khelforge does today
Section titled “What Khelforge does today”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.
What is planned
Section titled “What is planned”A study that compares the current path with alternatives on real AMD and NVIDIA machines is planned. Any gain is a hypothesis until measured.