Repository navigation
Fix Clang amalgamation warnings and enable compiler checks - #1881
InauguralPhysicist merged 1 commit into
Conversation
|
Thank you, @facelessdevhack. This is exactly the fix #1872 needed, and the review was easy because of how you did it. In particular:
A heads-up only, nothing to do: several of the helpers you marked Merging through the queue now. If you'd like another one in the same territory, #1876 (the suite's failure excerpt for long sanitizer reports shows the tail but loses the head) and #1877 ( |
Import #1881's per-site warning fixes and compiler-independent amalgamation warning check, preserving Phase 2 R1.5 numeric semantics (#1758). Principles: No silent wrong answers; Checks are anchored outside the system, narrow, and few. Resolve four hunks: retain the list_get_num bridge comment and its unused annotation; keep slot_is_numeric deleted and slot_is_ptr's SMI trap; retain SMI truthiness plus its unused annotation; keep INDEX_SET's existing initialized index, renamed float predicates/readers and #1775 comment. vm.c and builtins_tensor.c remain byte-identical to the first parent. Audit all six overlapping source files against the entire Phase 2 file. Hoist and initialize the six borrowed views once: slot_view writes every consulted type/payload/refcount before use; other paths return their real pointer or NULL. Preserve all Phase 2 INT/IDIV opcode-name cases. Retain nine individual optional-helper annotations; no global suppression, pragma, helper deletion or Phase 2-only warning fix is needed. Inventory: examined=2040 classified=2040 unclassified=0; moved_row_texts=118 (builtins.c 70, container.h 28, eigenscript.h 6, value_slot.h 14), new=0, removed=0. Ordered alignment finds 131 actual line shifts (83/28/6/14); 13 shifted builtins rows coincide with old row text, as in sync #2. Builtins: registered=312 numeric=231 classified=231 stale=0. Slot classifiers: D1=61 D2=19 D3=26 T=66 dispositions=106 missing=0 stale=0. Validation (fresh make release BASE=5bd396c2): - GCC -O0/-O1/-O2: 29 translation units each, 0 warnings. - GCC and Clang 18 amalgamation: 7 passed, 0 failed each; -O0/-O1 clean. - phase2_check --through R1.5 --baseline BASE: PASS; off/default/osr 72/72, trace 67/67, vacuous=0; controls 18/18, witnessed=27, controls_witnessed=13, controls_vacuous=0. - phase2_ci: PASS (derived through=R1.5). - phase2_lib_diff: 281423/281423 calls examined; listed_functions=12, undeclared=0 stale=0 PASS (standalone and CI). - Docs claims: PATHS 266, FLAGS 47, MAKE TARGETS 52, NAMES 432, DOC ENROLMENT 12; examples 202/202, 5 declared skips, 0 unreadable. - Shape: candidates=190 guarded=139 exempt=51 errors=0; no re-pin. - selftests --changed 3c454cb: enrolment 46/46, selected=0, failures=0. - Cost: 15 workloads, 30 tier rows, over_declared_max=0, stale_declarations=0 PASS; 60 fresh Cachegrind runs, no declaration edit. Full release/ASan/TSan and Memcheck suites are deferred to the orchestrator as instructed; only Cachegrind through phase2_cost.sh runs locally. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KC99CmwatKssQYggkBCgwF
What does this PR do?
Clang reports warnings in debug and lightly optimized amalgamation builds, so the existing warning check skips Clang. This change makes those builds warning-free and enables the same
-O0/-O1check for every selected compiler.&(#o)[3].-O1diagnostic.Fixes #1872.
Warning classification is posted in the issue comment. Per optimization level, Linux Clang 18 reports 97 deliberate prefix offsets and 10 optional unused helpers: 107 per invocation, 214 across both modes. Apple Clang 21 additionally reports six view-initialization diagnostics: 113 per invocation. All sites were audited; no runtime or concatenation bug was found. Each numeric view's consulted fields are written by
slot_viewbefore use. No warning class is globally suppressed, and optional APIs remain available.Validation
Enabled warning check against original production source: 5 passed, 2 failed, rejecting the real Clang warnings at both optimization levels. Fixed source: 7 passed, 0 failed with Apple Clang 21 and GNU GCC 15.2, including embedded evaluation and zero-live-allocation teardown.
Linux GCC 13
-O1also reproduces a pre-existing guardedINDEX_SETtemporary warning on unmodified main. The corrected explicit initialization passes the full amalgamation gate (7/7); optimized native Clang assembly is byte-identical to baseline.All 256 possible
uint8_topcode-name inputs produce byte-identical results before/after; indexed spelling compiles with-Wall -Wextra -Werroron both native compilers at both optimization levels.Full unsharded Linux arm64 GCC 13 and Clang 18 release suites: 4292/4292 passed each, 0 failed, 12 declared skips each (disabled extensions, unavailable optional tooling/assets, and build/architecture-specific cases).
make precheck: 19 passed, 0 failed, 0 skipped.make test-changed: 224/224 passed, 0 failed, 0 skipped. Runtime sources and the direct CI-invoked amalgamation script are explicitly reported outside the selected-section coverage.Focused index/error-path, container API/escape-view control and builtin direct/indirect checks: 55/55 passed; boolean behavior: 165/165 passed in each of default, interpreter, and non-strict modes.
Numeric-read gate: 190 reads, 72 reviewed functions, 0 violations/stale entries. Bash 3.2 syntax and
git diff --check: passed.Additional Linux x86-64 compile-only check with JIT enabled: GCC 13.3 and Clang 18 are warning-free at both
-O0and-O1; correct target headers and all four ELF64 x86-64 objects verified.Hosted validation at
606006c503b0e1bbdc6ab3abb7e87e8ecfe9c005: 25 successful checks, six conditional skips, zero failures. CI run completed successfully, including the hosted GCC suite and x86 JIT differential. CodeQL, documentation/WebAssembly and CodSpeed workflows also succeeded.Prepared with OpenAI Codex assistance and independently reviewed by a separate Codex agent.
Checklist
makeplus unshardedtests/run_all_tests.sh; counts and skips above).CHANGELOG.mdis unchanged.