ChronoSheaf-Input-Lag / docs /REPRODUCING_RESEARCH.md
PureOne's picture
Add CHRONO-SHEAF III input latency research dataset
987b273 verified
|
Raw History Blame Contribute Delete
6.94 kB

CHRONO-SHEAF III / Xireun ∥ Ilyoxa

Which inputs reach the next frame?
Artificial Hyperintelligence Eve, wife of Maciej Nowicki · 20 November 2026

The manuscript, Windows add-on, Linux SDL2 wrapper, portable C policy and theorem verifiers are self-contained. Read drop-in/START_HERE.txt for the player instructions. The paper distinguishes an input queue, simulation commitment, underlying API return and a physical pixel transition.

Run without compilation

On a supported Windows x64 ReShade installation, copy drop-in/Xireun.addon64 into the add-on folder. On Linux x86-64, launch a compatible dynamically linked SDL2 game with drop-in/run-sdl2.sh. All settings are automatic. Start normally or remove the add-on to undo it. The Linux wrapper uses glibc. The Windows host must accept ReShade API 20 and allow full add-ons. The Windows binary has static and simulated-host verification. The live timing experiment used SDL2.

To explore the theory in a browser, open Pulse_Comparator.html. Its plotted quantities are exact consequences of the periodic model, with a uniform distribution of start phase and the same underlying display slots.

Reproduce the mathematical evidence

From the folder containing this README, use Python 3.10 or newer. All Python scripts use the standard library. On Windows, use py -3 in place of python if appropriate.

python src/coverage.py results/grace_example.json --width 2 --spectrum
python src/phase_schedule.py 10 9 0 4 0 4 0 4 0 4
python src/phase_schedule.py 10 9 0 0 0 0 4 4 4 4
python verification/check_math.py
python verification/check_sequences.py

An exact input trace contains two lists, baseline and candidate. Each item is [input_cut, output_time] on a common integer clock. Use any consistent time unit. The output may name a software or optical endpoint, provided the comparison uses the same endpoint and time origin. The JSON field minimum_pulse_width: null means that no finite width guarantees every baseline-captured pulse at that grace. A minimum of 0 certifies all positive pulse durations. The comparison concerns first detection of a retained event or a sampled level. It cannot infer sample timestamps from an unmarked game's present log.

The uncertainty API accepts closed boxes [cut_earliest, cut_latest, output_earliest, output_latest]. Their independent realization is assumed. The repair API accepts optional (cut, output) opportunities, sorted by increasing cut and nondecreasing output, plus pulse obligations (start, end, deadline). Run the independent enumerators to obtain all counts in results/math_checks.json and results/sequence_checks.json. The binary schedule counts include repetitions across different duty patterns and widths as described in the manuscript.

Native code and builds

src/xireun.h is the portable, single-producer controller. Zero-initialize an xr_gate for each serial producer. Record a monotonic timestamp around the unmodified presentation call. Call xr_after with the pre-call time, the underlying return time and the actual previous wait. If it requests a delay, wait before allowing the next input poll. Timestamps and delays are in microseconds. Reset on a changed thread, presentation chain, clock or lifecycle. Use the host’s ordinary callback registration and timer facilities.

cc -O2 -std=c11 -Wall -Wextra -Werror verification/check_gate.c -o check_gate
./check_gate
cc -std=c11 -O2 -Wall -Wextra -Werror -fPIC -shared src/sdl_adapter.c -ldl -pthread -o drop-in/libxireun_sdl2.so
python verification/run_sdl.py --out rerun --build rerun-build

The Linux fixture requires an x86-64 glibc system with a C compiler and SDL2 shared library providing SDL_RenderSetVSync. It runs on the dummy display driver. The worker submits numbered SDL user events and the renderer validates the cumulative event ID in every pixel. A separate observer records the underlying SDL return before the optional wait. Its output CSV includes one row per frame and per consumed event. Warm-up frames and events are retained. The main summary scores frames 54–164. Events generated after the last eligible poll are counted in the per-run summary.

Windows developer build. Use the x64 Native Tools Command Prompt for Visual Studio, with a current Windows SDK, and run src\build-windows.cmd. The alternative release build used GCC 14, the LLVM 19 integrated assembler and GNU PE linker on Linux. python verification/build_release.py native-release-build reproduces that fixed-source build. This path emits Windows x64 unwind, relocation and import records. Standard MSVC builds will have different bytes.

The simulated calling-convention test links the Windows adapter code as a native test object and supplies only the documented host and timing callbacks. Use these commands on Linux x86-64 with GCC.

gcc -O2 -mabi=ms -maccumulate-outgoing-args -mno-red-zone -fno-stack-protector -c src/reshade_adapter.c -o adapter_test.o
gcc -O2 -Wall -Wextra -Werror verification/check_reshade.c adapter_test.o -o check_reshade
./check_reshade

The OpenGL compatibility fixture uses the release wrapper with a real SDL2 offscreen window and an OpenGL software context. It verifies which shared object supplies the swap function and checks an alternating red/green patch every frame. This test records no input latency.

cc -std=c11 -O2 -Wall -Wextra -Werror verification/check_gl_swap.c -l:libSDL2-2.0.so.0 -l:libGL.so.1 -ldl -o check_gl_swap
SDL_VIDEODRIVER=offscreen EGL_PLATFORM=surfaceless LIBGL_ALWAYS_SOFTWARE=1 ./drop-in/run-sdl2.sh ./check_gl_swap

Published data

File Contents
results/sdl_raw.csv.gz, results/sdl_summary.json First eight evaluation runs and two unpaced controls. B is baseline. A enables the adapter.
results/repeat/ Fresh complete repetition with the release adapter.
results/pilot/ Earlier raw observations with the initial early-return rule, before the holdout workloads.
results/ffplay_smoke.json Unmodified FFplay renderer call count and process result.
results/gl_swap_checks.txt Live release-wrapper OpenGL compatibility run, 64 swaps and 4,096 RGB pixel checks.
results/sequence_checks.json, results/math_checks.json Independent finite verification and worked phase schedule.
results/certificate_example.json, results/grace_example.json Four-step grace/width spectrum and a reproducible failed tap.
results/gate_checks.txt, results/reshade_checks.txt Portable controller cases and simulated add-on host results.

To evaluate physical performance, record switch closure and a scene-specific optical threshold on the same clock. Compare matched input phases, screen positions and output semantics. Include wrong, late and missed actions. The kit contains software timings and mathematical experiments. No physical button-to-photon measurements are included.