Glyph extents can span the full position range supplied by a callback.
Scale widened rectangle endpoints and clamp the rounded result instead
of narrowing inputs and relying on overflowing position arithmetic.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Synthetic emboldening updates callback-provided font extents with
unchecked position arithmetic. Saturate the sign adjustment and each
extents update.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Synthetic slanting and emboldening update callback-provided glyph
extents with unchecked position arithmetic. Widen and clamp the slant
geometry, then saturate sequential emboldening updates.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
AAT kerx format 4 derives mark offsets by subtracting callback or scaled
anchor coordinates. Saturate each coordinate difference so extreme
origins and public font scales cannot overflow.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
The optional split-kern path applies a ValueRecord to a temporary
position and redistributes it across the pair. Saturate every destination
update and clamp the one three-term expression after widening.
This closes the final unchecked GPOS position path for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Bulk origin fallback converts between horizontal and vertical origins
by adding advances and ascenders. Saturate those temporary position
updates before applying them to the buffer.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Synthetic emboldening updates callback-provided glyph advances and
origins. Saturate scalar and bulk results, including strength negation
for negative font scales.
This keeps public callback extremes from reintroducing position overflow
as part of the complete fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Computing synthetic emboldening strength could negate INT_MIN through
abs() and convert an out-of-range float to int32_t. Use floating-point
absolute value and clamp the rounded result to a valid position.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Font scaling can produce values outside hb_position_t at extreme public
font scales. Clamp design-unit, floating-point, and parent-font scaling
results before returning them to positioning code.
This ensures later saturating additions receive valid position operands
as part of the complete fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Arabic stch justification accumulates word and tile widths, then walks
repeated tiles to assign offsets. Saturate those hb_position_t values
and clamp the computed overlap from its 64-bit intermediate.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Fallback cluster positioning accumulates advances into mark offsets and
partitions ligature extents. Saturate the position accumulators and use
bounded 64-bit intermediates for the component formulas.
This completes the tracked fallback-shaping arithmetic covered by
Chromium's sanitizer exemption for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Fallback mark positioning combines several glyph extents and updates a
running attachment box. Use widened, clamped formulas where cancellation
matters and saturating arithmetic for sequential box updates.
Keep the original integer-division rounding behavior. This fixes the
remaining arithmetic in Chromium's fallback sanitizer exemption as
part of issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Provide an always-inline int64_t overload of hb_clamp_to for cold
position formulas that need wider intermediate arithmetic while
preserving integer division and rounding semantics.
Add boundary tests. This supports the complete position-overflow fix
for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Fallback mark positioning can preserve placement while zeroing mark
advances. Saturate that offset adjustment instead of subtracting
unchecked hb_position_t values.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Font-origin fallback code centralizes position updates in add, subtract,
and signed offset helpers. Make those helpers saturating, including the
INT_MIN case that previously overflowed while multiplying by -1.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Zeroing mark widths first moves their advances into the offsets. Use
saturating subtraction for that position update so extreme font scales
cannot overflow before GPOS is applied.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Glyph normalization accumulates cluster advances, moves offsets, and
then redistributes the result after sorting. Saturate each hb_position_t
update so very large clusters cannot overflow during normalization.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
AAT tracking adds the selected tracking value to the first glyph of
each grapheme. Saturate horizontal and vertical advance updates so an
extreme scale or repeated application cannot overflow hb_position_t.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
AAT kerx state-machine actions add scaled values to glyph advances and
offsets, including cross-stream attachments. Saturate each stored
position update to avoid signed overflow on repeated actions.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Legacy kern application split a kerning value across two glyphs with
unchecked additions to advances and offsets. Saturate those updates and
remove the signed-overflow sanitizer exemption from the function.
The exemption macro has no remaining tracked users, so remove it as
well. This is part of the complete fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Applying a synthetic slant combines a floating-point displacement with
an existing hb_position_t offset. Clamp the final result so extreme
slants cannot overflow the float-to-integer conversion or the position
sum.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Cursive attachment combines rounded anchors with existing advances and
offsets, then may negate the cross-stream displacement. Clamp the
floating-point conversions and saturate the integer arithmetic at each
stored hb_position_t result.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Reversing a cursive attachment chain negates the child's cross-stream
offset. Saturate that negation so INT_MIN produces INT_MAX instead of
signed-overflow undefined behavior.
This is part of the complete position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Add an always-inline saturating negation for position values that can
reach INT_MIN. Also require the floating-point clamp helper to inline,
matching the add and subtract helpers used throughout shaping.
Extend the boundary tests for both helpers. This supports the complete
position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
ValueRecord placement, advance, and device adjustments all update
hb_position_t fields. Saturate those additions and subtractions so
large scales or repeated lookups cannot invoke signed overflow.
The helper keeps the common path to one arithmetic instruction and a
not-taken overflow branch, which limits the cost in this hot path.
This is part of the complete fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Deferred mark and cursive attachment propagation combines offsets with
the advances between attached glyphs. Use saturating arithmetic for
each position update instead of relying on signed overflow behavior.
This removes the historical overflow from the function that issue
#6151 moved out of Chromium's sanitizer exemption.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
A mark can resolve its cross-stream position through a cursive
attachment chain. Saturate that accumulation so an overlong chain
cannot overflow hb_position_t while applying GPOS.
This is part of the position-overflow fix for issue #6151.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Mark-to-mark attachment can accumulate an unbounded cross-direction
offset. Clamp anchor conversion and saturate the immediate addition so
overlong mark clusters stop at hb_position_t limits instead of invoking
signed-overflow undefined behavior.
Add a regression for issue #6151 using 35,000 combining marks.
Testing: meson test -C build --print-errorlogs
Assisted-by: Codex <codex@openai.com>
Provide always-inline signed add and subtract helpers for position
arithmetic. Compiler overflow builtins reduce the common path to one
arithmetic instruction and a not-taken overflow branch.
This is the foundation for fixing the position overflow reported in
issue #6151.
Assisted-by: Codex <codex@openai.com>
SubsetGlyph stores borrowed slices into the source glyf table. Faces
created with a table callback may return a fresh blob on each request,
so destroying the population accelerator left those slices dangling
before they were serialized.
Retain the exact glyf blob through serialization. Exercise this path
by making the existing create-for-tables test return copied blobs.
Reported by WinD39 - Huynh Dinh Vu.
Fixes: https://issues.chromium.org/issues/536584255
Assisted-by: OpenAI Codex <codex@openai.com>
The paint session budget charged consumed outline edges at a flat
weight of 16 each, but the rasterizer's real cost per edge is
proportional to the rows it crosses: each edge is walked once per
scanline it spans. A glyph made of near-full-height zigzag edges
costs edge-count times surface-height row-steps while being charged
only 16 per edge, leaving the multiplication with the paint-graph
traversal limits under-counted.
Replace hb_raster_draw_get_edge_count() with
hb_raster_draw_get_edge_work(), which sums one unit per edge plus
its span in rows, clamped per edge to the surface height (edges are
clipped to the surface during rendering). The paint charge sites
now charge this real scanline work with no artificial weight.
Suggested by Behdad. Both fuzzer reproducers stay at ~0.12s;
rendering of regular color fonts is byte-identical; full test suite
passes.
Assisted-by: Claude Fable 5 <noreply@anthropic.com>
Gather the five session work-budget limits introduced by the
preceding commits into a single commented block in hb-limits.hh,
explaining the shared design: per-subsystem limits multiply when one
subsystem drives another, so each driving session carries one
cumulative budget, initialized once per top-level entry and only
ever decremented. No functional change; HB_VARC_MAX_WORK gains an
int64_t cast for consistency with its siblings.
Assisted-by: Claude Fable 5 <noreply@anthropic.com>
The raster seed drives ~2048 COLR PaintComposite nodes each costing
a full-surface composite; the gpu seed drives a VARC composite glyph
whose components each load a large glyf leaf glyph. Both timed out
on ClusterFuzz before the preceding work-budget commits.
Assisted-by: Claude Fable 5 <noreply@anthropic.com>
The paint-extents backend extracts a full glyph outline via
hb_font_draw_glyph() for every clip-glyph paint node, so the COLR
paint-graph traversal limits multiply with the per-glyph outline
limits (glyf points, CFF interpreter ops) when computing color-glyph
extents.
Add a work_left counter to hb_paint_extents_context_t, reset by
clear() (both users -- COLR extents and hb_font_t's paint-based
extents fallback -- start sessions through it) to the new
HB_PAINT_EXTENTS_MAX_WORK limit. Replace the plain draw-extents
sink with a local counting variant so each clip-glyph draw charges
the outline points it consumed; once the budget is exhausted,
further extractions are skipped and degrade to an empty clip. This
mirrors the session budgets in the raster, GPU, and vector paint
backends.
Full test suite passes.
Assisted-by: Claude Fable 5 <noreply@anthropic.com>
The SVG and PDF paint backends extract a fresh glyph outline via
hb_font_draw_glyph() for every fill-glyph and clip-glyph paint node,
each with a fresh per-glyph budget (glyf points / CFF interpreter
ops), and append the formatted path data to the output document.
The COLR paint-graph traversal limits multiply with those per-glyph
limits, and the generated path data grows unboundedly.
Add a work_left counter to hb_vector_paint_t, reset per session by
hb_vector_paint_clear() to the new HB_VECTOR_MAX_PAINT_WORK limit
and charged with the bytes of path data generated by each outline
extraction. Once exhausted, further extractions are skipped: an
empty path (or empty clip path) keeps the document structure intact.
This mirrors the session budgets in the raster and GPU paint
backends.
Full test suite passes; normal SVG output is unaffected.
Assisted-by: Claude Fable 5 <noreply@anthropic.com>
The GPU paint encoder already bounds the number of clip-glyph
sub-blobs per paint walk (HB_GPU_PAINT_MAX_SUB_BLOBS), but each
encode re-extracts a full glyph outline with a fresh per-glyph
budget: 1024 sub-blobs times 200k glyf points still multiplies into
a fuzzer timeout, since the memoized sub-blob index is reset on
every clip push.
Add a work_left counter to hb_gpu_paint_t, reset per walk by
hb_gpu_paint_clear() to the new HB_GPU_PAINT_MAX_WORK limit and
charged with the curves consumed by each clip-glyph and clip-path
encode. Once exhausted, further clip encodes are skipped and the
walk is marked unsupported, matching the existing sub-blob-cap
degradation. This mirrors the session budgets added to the raster
paint backend and VARC.
Both fuzzer reproducers stay at ~0.12s locally. Full test suite
passes.
Assisted-by: Claude Fable 5 <noreply@anthropic.com>
VARC bounds its own composite-graph traversal (edge count, nesting
depth, decycler), and each leaf glyph loaded from glyf/CFF/CFF2 is
bounded by that table's per-glyph limit (HB_GLYF_MAX_POINTS,
HB_CFF_MAX_OPS), but the two budgets multiply: one composite glyph
can reference thousands of components, each drawing a leaf glyph
worth 200k points/ops, timing out the fuzzer.
Add a budget_left counter to hb_varc_context_t, initialized once per
top-level get_path/get_extents entry to the new HB_VARC_MAX_WORK
limit and shared by all leaf loads. Leaf loaders report their
consumption through a new optional int64_t *budget parameter: glyf
charges the points it processed (scratch.all_points holds exactly
this glyph's points), and the CFF/CFF2 charstring interpreter charges
executed ops, threaded through get_path/get_extents(_at) of both
tables. Once the budget is exhausted, remaining leaves are skipped
best-effort; a single in-flight leaf may overshoot by at most one
per-glyph limit. Existing callers (hb-ot-font) pass no budget and
are unchanged. CFF1 seac component recursion is left uncharged; it
is bounded at two extra charstrings per gated leaf.
Reduces the hb-gpu-fuzzer reproducer (VARC components each loading
large glyf leaf glyphs) from 3.75s to 0.13s locally (was >60s on
instrumented ClusterFuzz builds); rendering of the VARC hanzi and
hangul test fonts is byte-identical before and after. Full test
suite passes.
Assisted-by: Claude Fable 5 <noreply@anthropic.com>
The COLR paint-graph traversal is bounded by its own limits (edge
count, nesting depth), and each raster paint operation is bounded by
surface size, but the two budgets multiply: a font with ~2048 paint
nodes where each node costs a full-surface pass (PaintComposite's
pop_group compositing, push_clip_glyph's clip-buffer pass) performs
billions of pixel operations, timing out the fuzzer.
Add one cumulative work budget per paint session (everything painted
between two render/clear calls), tracked in hb_raster_paint_t and
initialized to the larger of a flat floor and a few full passes over
the surface, so client-sized large surfaces keep proportional
headroom. Pixel loops (composites, fills, gradients, images, clip
passes) charge their area; glyph-outline work charges the consumed
rasterizer edges with a fixed weight, read back through a new
internal hb_raster_draw_get_edge_count() helper. Once the budget is
exhausted, operations are skipped best-effort: clip pushes degrade to
empty clips and glyph-outline extraction is skipped entirely, so
per-glyph outline limits (glyf points, CFF interpreter ops) cannot
multiply with the caller's traversal limits either.
Reduces the fuzzer reproducer from 0.92s to 0.11s locally (was >60s
on instrumented i386 ClusterFuzz builds); rendering of regular color
fonts is byte-identical before and after. Full test suite passes.
Assisted-by: Claude Fable 5 <noreply@anthropic.com>
* [subset] Clamp variable advances to UFWORD range in plan
When instancing, the hmtx/vmtx advance is computed by adding the
HVAR/VVAR delta to the base advance. The delta is attacker-
controlled and unbounded, so the sum can go negative or exceed
65535. The negative case, cast to unsigned, produced advances
near 4 billion in hmtx_map; CFF::optimize_widths () then looped
over the full [min_w, max_w] width range, taking minutes (the
oversized cumsum resize fails cleanly, so this was a pure hang,
no memory unsafety).
Clamp the computed advance to [0, 0xFFFF], matching the UFWORD
range that hmtx/vmtx serialization stores and the hb_max (0.f, …)
clamp already used by the runtime metrics path.
Fixes a ClusterFuzz timeout in hb-subset-fuzzer (testcase
4846730722738176, minimized from timeout-fd8f4bd2a650). The
testcase went from >60s to 5ms; added as a fuzz seed. Full
meson test suite passes.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* [raster] Fix signed overflow computing row bottom at coordinate limit
edge_sweep_row () computed y_bot = y_top + ONE_PIXEL in int32. The
scanline loop clamps y_top itself to INT32_MAX, but when the surface
sits at the extreme of the 24.8 fixed-point coordinate space y_top
can be within ONE_PIXEL of INT32_MAX (0x7FFFFF00), and the addition
overflows: UBSan "2147483392 + 256 cannot be represented in type
'int'".
Saturate the addition at INT32_MAX using the same 64-bit-then-clamp
idiom already used for y_top and the x interpolation. Edges are
int32-clamped too, so no coverage exists beyond INT32_MAX and the
clipped bottom band loses nothing real.
Fixes ClusterFuzz issue 541858526 (testcase 5513551012495360).
Reproduced with a -Db_sanitize=undefined build: one UBSan report
before, clean after. Testcase added as a fuzz seed. Full meson
test suite passes.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
* [raster] Cap font-derived surface dimensions at 4096 pixels per side
When no extents are set explicitly, the paint and draw contexts
derive the surface size from font data: glyph extents (which the
auto path in hb_raster_paint_glyph_impl () feeds through
set_glyph_extents ()) or the accumulated outline bounds in
hb_raster_draw_render (). A malicious font with a tiny upem and
huge glyph coordinates turns that into arbitrarily large
allocations: a 49 KB fuzz font produced several ~885 MB BGRA
surfaces live at once (root surface plus one per PaintComposite
push_group), nearly 4 GB total.
Add HB_RASTER_MAX_AUTO_DIMENSION (4096) to hb-limits.hh and clamp
width/height at the three font-derived sizing points: both
set_glyph_extents () implementations and draw render's
auto-size-from-edges path. Since push_group and clip surfaces
inherit fixed_extents, the cap bounds those too. Extents set
explicitly via hb_raster_{draw,paint}_set_extents () are not
limited.
Fixes an hb-raster-fuzzer out-of-memory finding (testcase
6344015149858816): peak RSS 3.47 GB before, 350 MB after.
Testcase added as a fuzz seed. Full meson test suite passes.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>
When no extents are set explicitly, the paint and draw contexts
derive the surface size from font data: glyph extents (which the
auto path in hb_raster_paint_glyph_impl () feeds through
set_glyph_extents ()) or the accumulated outline bounds in
hb_raster_draw_render (). A malicious font with a tiny upem and
huge glyph coordinates turns that into arbitrarily large
allocations: a 49 KB fuzz font produced several ~885 MB BGRA
surfaces live at once (root surface plus one per PaintComposite
push_group), nearly 4 GB total.
Add HB_RASTER_MAX_AUTO_DIMENSION (4096) to hb-limits.hh and clamp
width/height at the three font-derived sizing points: both
set_glyph_extents () implementations and draw render's
auto-size-from-edges path. Since push_group and clip surfaces
inherit fixed_extents, the cap bounds those too. Extents set
explicitly via hb_raster_{draw,paint}_set_extents () are not
limited.
Fixes an hb-raster-fuzzer out-of-memory finding (testcase
6344015149858816): peak RSS 3.47 GB before, 350 MB after.
Testcase added as a fuzz seed. Full meson test suite passes.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
edge_sweep_row () computed y_bot = y_top + ONE_PIXEL in int32. The
scanline loop clamps y_top itself to INT32_MAX, but when the surface
sits at the extreme of the 24.8 fixed-point coordinate space y_top
can be within ONE_PIXEL of INT32_MAX (0x7FFFFF00), and the addition
overflows: UBSan "2147483392 + 256 cannot be represented in type
'int'".
Saturate the addition at INT32_MAX using the same 64-bit-then-clamp
idiom already used for y_top and the x interpolation. Edges are
int32-clamped too, so no coverage exists beyond INT32_MAX and the
clipped bottom band loses nothing real.
Fixes ClusterFuzz issue 541858526 (testcase 5513551012495360).
Reproduced with a -Db_sanitize=undefined build: one UBSan report
before, clean after. Testcase added as a fuzz seed. Full meson
test suite passes.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
When instancing, the hmtx/vmtx advance is computed by adding the
HVAR/VVAR delta to the base advance. The delta is attacker-
controlled and unbounded, so the sum can go negative or exceed
65535. The negative case, cast to unsigned, produced advances
near 4 billion in hmtx_map; CFF::optimize_widths () then looped
over the full [min_w, max_w] width range, taking minutes (the
oversized cumsum resize fails cleanly, so this was a pure hang,
no memory unsafety).
Clamp the computed advance to [0, 0xFFFF], matching the UFWORD
range that hmtx/vmtx serialization stores and the hb_max (0.f, …)
clamp already used by the runtime metrics path.
Fixes a ClusterFuzz timeout in hb-subset-fuzzer (testcase
4846730722738176, minimized from timeout-fd8f4bd2a650). The
testcase went from >60s to 5ms; added as a fuzz seed. Full
meson test suite passes.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
When the skipping iterator fails to find another kernable glyph,
resume at the position it reports instead of retrying from the next
glyph. This prevents a suffix of ignored marks from being scanned
repeatedly while preserving later feature ranges.
Assisted-by: OpenAI Codex <codex@openai.com>
Insertion state machines may emit glyphs during the end-of-text transition, when the buffer has no current input glyph. Emit the glyph first in that case and apply AAT metadata to the new output glyph instead of buffer->cur().
Add a regression font whose end-of-text action inserts the AAT deleted-glyph sentinel.
Assisted-by: OpenAI Codex <noreply@openai.com>
_hb_gpu_slug_single casts its horizontal ray leftward or rightward
depending on which side of the band's split point the fragment is on,
and likewise for the vertical ray. The crossing signs it accumulates
are the same either way.
But over a closed contour the signed crossings of a line sum to zero,
so counting the crossings on the left gives exactly the negative of
counting them on the right (clamp(0.5 + u) + clamp(0.5 - u) == 1, so
this holds for the antialiased partial coverages too). Whenever
hLeftRay and vLeftRay disagree, xcov and ycov therefore came out with
opposite signs, and _hb_gpu_calc_coverage's
abs (xcov * xwgt + ycov * ywgt) / (xwgt + ywgt)
subtracted the two estimates instead of averaging them.
Glyph interiors were unaffected -- the min (abs (xcov), abs (ycov))
term floors the result there -- so this never showed as a hole. It
showed as edges that antialias too light wherever both weights are
nonzero and the two estimates differ.
Flip the sign back after each loop. With a CPU port of
_hb_gpu_slug_single, comparing against plain Slug (rightward rays
over the full curve list, which is what the sign convention in
_hb_gpu_calc_coverage assumes), util/gpu/default-font.ttf at scale
163 rendered at 107px had 1700 pixels differing by more than 0.05
before this change, always too dark, and none differing by more than
0.001 after -- the split optimization is now exact.
Same fix in all four shading languages. The GLSL was checked with
glslc; the HLSL, MSL and WGSL edits are the same two statements and
were not machine-compiled.
Assisted-by: Claude Opus 5 (1M context) <noreply@anthropic.com>