Skip to content

fix(poc): un-rot the OpenGL renderer (ADR-0039) + headless GL CI gate#31

Merged
delta9000 merged 3 commits into
mainfrom
fix/poc-renderer-adr0039
Jun 28, 2026
Merged

fix(poc): un-rot the OpenGL renderer (ADR-0039) + headless GL CI gate#31
delta9000 merged 3 commits into
mainfrom
fix/poc-renderer-adr0039

Conversation

@delta9000

Copy link
Copy Markdown
Owner

Why

The OpenGL example consumer (examples/poc_renderer/) hadn't compiled since ADR-0039 moved the value types into x3d::core and node types into x3d::nodes: it named SFVec3f/SFColor/SFImage/SFColorRGBA/X3DNode &c. 69 times unqualified, with no using namespace. It went unnoticed because neither renderer consumer (cpu_raster, poc_renderer) is built by mise run ci — the exact same blind spot that rotted cpuraster (#28). One main.cpp comment even still documented the pre-ADR-0039 global namespace.

What

  1. Fix the drift — pull both namespaces in (scoped), mirroring the cpuraster fix, rather than qualifying 69 sites. Fix the stale comment in input.cpp.

  2. Close the blind spot with a real headless gate. A new unconditional CI job examples-gate (every PR) and mise run validate-examples both call scripts/validate-examples.sh, which:

    • builds both examples,
    • runs each --headless probe (no GL),
    • exercises the real OpenGL pipeline headlesslypoc --screenshot under xvfb-run + mesa software GL (llvmpipe), asserting exit 0 + a non-empty frame.

    This mirrors the sibling ../x3d-render validation path (GLFW offscreen + glReadPixels). __GLX_VENDOR_LIBRARY_NAME=mesa forces software GL where a GPU GLX driver is also present (NVIDIA ignores LIBGL_ALWAYS_SOFTWARE); a GPU-less CI runner lands on llvmpipe automatically.

Verified locally

Both examples build; both --headless probes report 5 render items on raster_smoke.x3d; the Xvfb --screenshot path renders a 1280×720 frame, exit 0. As an extra check, the same OpenGL pipeline rendered the NURBS teapot patch-for-patch identically to the CPU rasterizer — two independent consumers of the extraction seam, both correct, both headless.

Renderer-side breaks in either consumer can no longer hide from CI.

The out-of-SDK PoC OpenGL renderer named the value types (SFVec3f, SFColor,
SFImage, SFColorRGBA, ...) and node types (X3DNode) unqualified, from before
ADR-0039 moved them into x3d::core / x3d::nodes. It hadn't compiled since.
Like the cpuraster fix, pull both namespaces in (scoped) rather than qualify
69 call sites. Also corrects a stale comment that documented the pre-ADR-0039
global-namespace layout.

Neither example consumer is built by 'mise run ci', so both silently rotted on
the namespace move. Verified headless: --headless probe (32 items) and the GL
--screenshot path under 'xvfb-run' both exit 0 and render the NURBS teapot.
The two out-of-SDK consumers (cpu_raster, poc_renderer) are OFF by default and
never built by 'mise run ci', so ADR-0039's namespace move silently rotted both.
Close the blind spot:

- scripts/validate-examples.sh: single source of truth — builds BOTH examples,
  runs their --headless probes, and exercises the poc OpenGL pipeline headlessly
  via --screenshot under xvfb-run + mesa software GL (llvmpipe), asserting exit 0
  and a non-empty frame. Mirrors sibling ../x3d-render's offscreen-GL approach.
- mise.toml: 'mise run validate-examples' runs the script.
- .github/workflows/ci.yml: new unconditional 'examples-gate' job (every PR)
  installs xvfb + mesa-dri + GLFW's X11/Wayland build deps and runs the script.
- poc README + main.cpp header: document the headless GL validation; drop the
  now-false 'never executed headless in CI' claim.

__GLX_VENDOR_LIBRARY_NAME=mesa forces software GL where a GPU GLX driver is also
present (NVIDIA ignores LIBGL_ALWAYS_SOFTWARE); GPU-less CI lands on llvmpipe.
--animate <dir> --fps <n> --duration <s>: drive the event graph at a FIXED dt
(frame/fps, starting at +dt so it is strictly increasing past the bring-up tick(0))
and dump every frame as <dir>/frame_NNNN.ppm, then exit. Deterministic, loop-seamless
capture of the realtime GL loop (interpolators/sequencers/ROUTEs) for headless demo
reels — the testbed used to find SW-DELTA-1 by diffing the PoC's incremental delta()
output against cpuraster's full-snapshot output.
@delta9000 delta9000 force-pushed the fix/poc-renderer-adr0039 branch from 51882b4 to 6699de1 Compare June 28, 2026 00:25
@delta9000 delta9000 merged commit 1f12693 into main Jun 28, 2026
13 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant