build: gcc 15 hits the same -Warray-bounds false positive, so widen the demotion guard - #1293
Conversation
|
The GCC 15 diagnosis and version-gate change look correct, but this branch is currently conflicting with |
4145acb to
a277ac1
Compare
…he demotion guard The guard added the -Wno-error=array-bounds escape hatch for GCC >= 16 only, and its comment asserted that everything at or below 15 still fails the build on a real out-of-bounds. gcc 15.2.0 reproduces the same false-positive class from the other libstdc++ container: std::vector<float>'s inlined copy-construct plus _M_allocate, reported at ltx2_samplers.cpp:161,163 against a bound of float[2305843009213693951]. That bound is SIZE_MAX/4, the allocator's unconstrained size range rather than a real object, which is the inlining attribution the guard's own comment already documents for _M_release. The subscripts are sigmas.back() on a copy of a container that VT_CHECK proves holds at least two elements three lines above, and GCC does not propagate that throwing check through the inlined copy. main therefore did not build on gcc 15.x at all, stopping at 146/1552, and no CI lane covers the release: the matrix is gcc 13 on every ordinary Linux lane and gcc 16 in build-newest-gcc, which the guard already exempts, so the failure sits exactly between the two points. gcc 15 is the current toolchain on Arch, NixOS unstable and Fedora 42. Measured on 4ee5f4a with gcc 15.2.0: the translation unit is exit 1 with two -Werror=array-bounds= errors, and exit 0 with the same two as warnings once the guard applies, so the diagnostic stays visible exactly as intended. scripts/agent-preflight.sh fails the identical 10 gates before and after. Whether CI should also cover gcc 14 and 15 is a separate question and is deliberately not bundled here, because the widened guard already prevents this defect recurring and a lane would guard a different class. Closes mudler#1292 FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: Claude:claude-sonnet-5 [Claude Code]
a277ac1 to
ebf96e3
Compare
|
Rebased as requested. The remaining red does not come from this change. I rebased onto Facts:
Inference: a one-line Markdown addition cannot fail five model tests. The red comes from the base. The same file explains the conflict. GitHub does not apply the |
Brings the branch to current main so the union merge driver resolves the issue-index append locally. GitHub's server-side merge does not apply custom merge drivers, which is the only reason the pull request read CONFLICTING. FOLLOWING_AGENTS_PROTOCOL Following-Agents-Protocol: true AI-Assisted: true Assisted-by: Claude:claude-opus-5 [Claude Code]
The guard added the -Wno-error=array-bounds escape hatch for GCC >= 16 only, and
its comment asserted that everything at or below 15 still fails the build on a
real out-of-bounds. gcc 15.2.0 reproduces the same false-positive class from the
other libstdc++ container: std::vector's inlined copy-construct plus
_M_allocate, reported at ltx2_samplers.cpp:161,163 against a bound of
float[2305843009213693951]. That bound is SIZE_MAX/4, the allocator's
unconstrained size range rather than a real object, which is the inlining
attribution the guard's own comment already documents for _M_release. The
subscripts are sigmas.back() on a copy of a container that VT_CHECK proves holds
at least two elements three lines above, and GCC does not propagate that
throwing check through the inlined copy.
main therefore did not build on gcc 15.x at all, stopping at 146/1552, and no CI
lane covers the release: the matrix is gcc 13 on every ordinary Linux lane and
gcc 16 in build-newest-gcc, which the guard already exempts, so the failure sits
exactly between the two points. gcc 15 is the current toolchain on Arch, NixOS
unstable and Fedora 42.
Measured on 4ee5f4a with gcc 15.2.0: the translation unit is exit 1 with two
-Werror=array-bounds= errors, and exit 0 with the same two as warnings once the
guard applies, so the diagnostic stays visible exactly as intended.
scripts/agent-preflight.sh fails the identical 10 gates before and after.
Whether CI should also cover gcc 14 and 15 is a separate question and is
deliberately not bundled here, because the widened guard already prevents this
defect recurring and a lane would guard a different class.
Closes #1292
FOLLOWING_AGENTS_PROTOCOL
Following-Agents-Protocol: true
AI-Assisted: true
Assisted-by: Claude:claude-sonnet-5 [Claude Code]