Skip to content

fix: voxel cache rendering corruption - #77

Merged
ZivDero merged 5 commits into
OpenTS-Developers:mainfrom
Belonit:fix/stabilize-voxel-cache-rendering
Aug 30, 2026
Merged

fix: voxel cache rendering corruption#77
ZivDero merged 5 commits into
OpenTS-Developers:mainfrom
Belonit:fix/stabilize-voxel-cache-rendering

Conversation

@Belonit

@Belonit Belonit commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix several independent correctness problems in voxel rendering that are
exposed by optimized clang-cl builds and can corrupt cached images.

Expected result: every cached voxel image contains only pixels produced for
that render, without coloured artifacts around voxel units.

The four fixes are:

  • Harden RLE compression by stopping transparent runs at the input boundary
    and sizing its temporary buffer for a worst-case voxel row.
  • Correct adjacent-pixel writes so the second pixel uses the complete next
    packed-buffer index.
  • Remove undefined fixed-point conversions by converting through int before
    wrapping to unsigned 8.8 coordinates.
  • Clear the complete colour and depth work buffers before each voxel render,
    removing unreliable previous-region tracking and the now-unused partial-clear
    helpers. The performance impact on modern systems is minimal because one
    contiguous memset is better optimized than many row-by-row calls.

Behavior and compatibility

Bug fix. Maps, rules, saved games, replays, network data formats, deterministic
simulation, and COM/ABI surfaces are unchanged. The change affects only the
temporary voxel rendering cache; no migration is required.

Validation

  • The experimental Linux clang-cl cross-build completed successfully.
  • Runtime check: reproduce a voxel cache render after a prior differently sized
    render and confirm that the coloured artifact is absent.
  • The supported Visual Studio 2022 Win32 Debug and Release builds were not run.

Documentation

No documentation change is needed. These are internal rendering correctness
fixes that do not change a documented interface or workflow.

Checklist

  • The change is focused; unrelated mechanical cleanup is separate
  • Compatibility effects and any migration are explicit
  • Documentation impact is stated
  • Validation distinguishes what passed, failed, and was not run
  • No prohibited assets, binaries, SDKs, credentials, or generated output are included

@github-actions

github-actions Bot commented Aug 29, 2026

Copy link
Copy Markdown

Development builds of cd5f29c:

The links work without a GitHub account. Artifacts expire after 90 days, and this comment follows the latest successful build.

@Belonit
Belonit marked this pull request as draft August 29, 2026 22:28
Stop transparent runs at the input boundary and size the temporary buffer for worst-case voxel rows.
Advance the complete packed buffer index so the second write targets the neighboring pixel.
Convert through int before unsigned short so 8.8 coordinates wrap predictably instead of saturating in optimized clang builds.
Clear the complete color and depth buffers for each cache render, and remove obsolete previous-region tracking and partial-clear helpers.
@Belonit
Belonit force-pushed the fix/stabilize-voxel-cache-rendering branch from 5f7e6da to 2ccf4ea Compare August 30, 2026 10:09
@Belonit Belonit changed the title fix: stabilize voxel cache rendering fix: voxel cache rendering corruption Aug 30, 2026
@Belonit

Belonit commented Aug 30, 2026

Copy link
Copy Markdown
Contributor Author

Updated after identifying the root cause: undefined conversions in the 8.8 fixed-point coordinate calculations.

@Belonit
Belonit marked this pull request as ready for review August 30, 2026 10:11
@ZivDero ZivDero added the no change record Engine change needs no manual change record label Aug 30, 2026
@ZivDero
ZivDero merged commit 9cd1fbb into OpenTS-Developers:main Aug 30, 2026
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no change record Engine change needs no manual change record

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants