Skip to content

Core-only Linux build with CI, sanitizer fixes and a limitations list - #1

Merged
syfyra merged 5 commits into
mainfrom
claude/relaxed-lovelace-19rxu2
Nov 10, 2026
Merged

syfyra merged 5 commits into
mainfrom
claude/relaxed-lovelace-19rxu2

Conversation

@syfyra

@syfyra syfyra commented Nov 10, 2026 •

Copy link
Copy Markdown
Owner

Summary

The renderer core could only be built with MSVC against a Houdini installation, so it had no second compiler, no sanitizer coverage and no CI. This PR makes nova_core and its unit tests build on Linux without Houdini, runs them in CI, fixes what the sanitizers and a review of the loaders found, and collects Nova's current limitations in one document.

Not verified here: the Windows build with Houdini and the GPU kernels. Everything was built and tested with GCC 13 on Linux only; kernels.cu and the MSVC build were not compiled, and no [gpu] test ran. A build on Windows with Houdini is still owed.

Changes

Core-only build (NOVA_CORE_ONLY)

  • cmake/NovaStandalone.cmake: TBB, OpenSubdiv, Embree and Catch2 from the system; the NanoVDB 32.6 headers Houdini 22.0 ships are fetched from the OpenVDB repository when the system has none or older ones.
  • Presets core (Release) and core-sanitize (AddressSanitizer, UBSan, float casts). It is the default away from Windows.
  • Leaves out the Hydra delegate, the Houdini package, nova_cli, nova_imgcmp and the GPU backend.
  • The full Windows build changes only by two new interface targets, Nova::OpenSubdiv and Nova::NanoVDB, that stand for Houdini's osdCPU and toolkit headers.
  • Two portability fixes GCC needed (subdiv.cpp, surface.cpp) and a warning-clean -Wall build.

CI

  • .github/workflows/core.yml: both presets on Ubuntu 24.04, on pull requests and pushes to main.

Fixes (details in docs/bug-audit-2026-11.md, section 9)

  • S-1, float-to-int conversions. Converting a float beyond int's range or a NaN is undefined: x86 gives INT_MIN, CUDA saturates and turns NaN into 0, so CPU and GPU could shade such values differently. Noise cells, the HSV hue sector, octave counts and the volume modifiers' start level now convert through toInt / clampToInt (core/math/common.h) and give what the CPU gave. In-range values are unchanged.
  • S-2, Texture Baker. A triangle with a UV corner far outside the tile (from u = 1e6 with a full lookup grid) was in no cell of the grid and was never found.
  • S-3, checkpoints. loadCheckpoint checked four of the adaptive sampler's ten per-pixel arrays; a file with a shorter one loaded and was read past its end. A fill stride of 0 loaded too.

Docs

  • docs/limitations.md: what Nova 0.1.0 does not do, by area, with what happens instead and where it comes from.
  • The README documents the core-only build; the design notes M3, M8, M10, M11-P6 and M11-P8 note the fixes where they describe the code.

Testing

  • ctest --preset core: 398 tests, 393 pass, 5 skip (they need a GPU).
  • ctest --preset core-sanitize: the same, with no sanitizer finding.
  • Both jobs of the new workflow pass on this PR.
  • 6 new test cases. The bake and checkpoint tests fail on the old code.
  • 210 000 random light path expressions through lpe::compile under the sanitizers, no finding.

🤖 Generated with Claude Code

https://claude.ai/code/session_019BqpPjzxKkWa7ay5MgDGrc

…sdf_precompute with GCC on Linux against system libraries

NOVA_CORE_ONLY (the default away from Windows) leaves out the Hydra
delegate, the Houdini package, nova_cli, nova_imgcmp and the GPU backend and
takes TBB, OpenSubdiv, Embree and Catch2 from the system
(cmake/NovaStandalone.cmake). The NanoVDB 32.6 headers Houdini 22.0 ships
are fetched from the OpenVDB repository when the system has none or older
ones. Presets: core (Release) and core-sanitize (AddressSanitizer, UBSan,
float casts).

The full Windows build is unchanged apart from two new interface targets,
Nova::OpenSubdiv and Nova::NanoVDB, that stand for Houdini's osdCPU and
toolkit headers.

What GCC 13 needed:
- subdiv.cpp: a vector constructor that GCC parses as a function
  declaration (static_cast in place of the functional cast).
- surface.cpp: <iterator> for std::begin and std::end.
- -march=haswell and -ffp-contract=off: the instruction sets of /arch:AVX2,
  and no FMA contraction, as MSVC and the GPU kernels (--fmad=false).
- Warnings: the two light types the scene builds itself named in
  buildLightData's switch, three arrays initialised, an unused copy of
  inversePoint removed from scene.cpp.

All 392 unit tests of nova_tests pass on Linux (387; the 5 GPU tests skip).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019BqpPjzxKkWa7ay5MgDGrc
…r UV corner no longer drops a triangle from the bake grid

An AddressSanitizer and UBSan run of the unit tests (core-sanitize preset)
found no memory error and one class of undefined behaviour: floats
converted to int beyond int's range or as NaN. x86 gives INT_MIN there,
CUDA saturates and turns NaN into 0, so the CPU and the GPU could shade
such values differently.

- core/math/common.h: toInt (truncation; INT_MIN out of range and for NaN,
  what the CPU gave) and clampToInt (clamped as a float first).
- Noise: floorInt goes through toInt; Worley's neighbour cells are summed
  in 64 bits (INT_MIN - 1 overflowed). In-range positions hash as before.
- hsvToRgb's hue sector and the fractal opcode's octave count use toInt.
- Volumes: the multiple-scattering start level is clamped before lround
  (NaN: level 0), which also bounds the level difference.
- MemorySampler: texel coordinates through toInt.
- Bake: the lookup grid's cell range was converted before it was clamped,
  so a triangle with a UV corner past 2^31 grid cells (u = 1e9; with a
  2048 grid from u = 1e6) covered no cell and was never found. It is
  clamped as a float now.

Tests: toInt and clampToInt, noise at positions beyond int's range, octave
counts, the start level, and a bake lookup inside a triangle that reaches
u = 1e9 (fails before the fix).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019BqpPjzxKkWa7ay5MgDGrc
…ecked on load

loadCheckpoint compared four of the adaptive sampler's ten per-pixel arrays
with the film's pixel count. A file whose evaluated, noisy, halfAlpha, dsq,
lum or dsqAlpha array was shorter loaded, and the oracle then indexed it by
pixel past its end. All ten must have one value per pixel now, and a fill
stride of 0 (hosts divide by it) or beyond 65536 is refused.

Test: "Checkpoints with a short adaptive-sampling array are refused" (the
old loader accepts six of the ten shortened files and the zero stride).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019BqpPjzxKkWa7ay5MgDGrc
… in the README, a workflow that builds and tests the core

- docs/limitations.md: what Nova 0.1.0 does not do, by area, with what
  happens instead and where it comes from (the code's warnings and the
  design notes, each checked against the code). The per-milestone "Not yet"
  lines of the reference describe their milestone; the reference says so.
- README: the core-only build, its presets and what it leaves out.
- docs/bug-audit-2026-11.md, section 9: the sanitizer pass (S-1 to S-3) and
  what it did not cover (the GPU kernels, the Windows build, Hydra).
- .github/workflows/core.yml: on pull requests and pushes to main, the core
  and its unit tests on Ubuntu 24.04 with the core and core-sanitize
  presets.
- tests: in a core-only build ctest reports the tests that skip themselves
  without a GPU as skipped (Catch2's exit code 4), not as failed.

ctest --preset core and ctest --preset core-sanitize: 398 tests, 393 pass,
5 skip.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019BqpPjzxKkWa7ay5MgDGrc
…e, the build modules and CI in the README's layout

- M3: the kernel-side rule for float-to-int conversions (K14) and the
  noise's cells beyond int's range (M3.7).
- M10: the conversions under CPU/GPU agreement (G0 notes).
- M8: the clamped start level of the volume modifiers.
- M11-P6: what a checkpoint must match to be read.
- M11-P8: the lookup grid's cell range of a triangle.
- README: cmake/ and .github/workflows/ in the repository layout; what the
  sanitizer preset checks.
- Reference: the core-only test presets and the skipped GPU tests.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019BqpPjzxKkWa7ay5MgDGrc
@syfyra syfyra changed the title Claude/relaxed lovelace 19rxu2 Core-only Linux build with CI, sanitizer fixes and a limitations list Nov 10, 2026
@syfyra
syfyra merged commit cee101e into main Nov 10, 2026
2 checks passed
@syfyra
syfyra deleted the claude/relaxed-lovelace-19rxu2 branch November 10, 2026 22:24
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.

2 participants