Skip to content

build: PR0 — production native build config, C++23 wrapper, dead code removal#2

Open
mrmidi wants to merge 1 commit into
pr-1/measurement-safetyfrom
pr0/native-build
Open

build: PR0 — production native build config, C++23 wrapper, dead code removal#2
mrmidi wants to merge 1 commit into
pr-1/measurement-safetyfrom
pr0/native-build

Conversation

@mrmidi

@mrmidi mrmidi commented Jul 20, 2026

Copy link
Copy Markdown
Owner

PR0 — Production-Like Native Build

Base: pr-1/measurement-safety (stacked PR chain)

C++23 (full stack)

  • FptnLib/CMakeLists.txt: -std=c++23, cxx_std_23
  • project.yml + Tools/FptnCLI/project.yml: CLANG_CXX_LANGUAGE_STANDARD: c++23
  • fptn submodule pinned to 83f0357 — C++23 + local YAFF compatibility patch + pinned YAFF source (d6f7467, SHA-256 verified)
  • YAFF fix: C++23 libc++ ranges probes .begin() eagerly via input_or_output_iterator concept; local Conan recipe defers BaseArray::begin/end to out-of-line definitions after ArrayIterator is fully defined. Upstream yandex/yaff untouched.

Dead code removal (verified zero references)

Removed Reason
-DO3 Preprocessor macro named O3, not the -O3 optimization flag
-DNDEBUG (unconditional) Now Debug-only; assertions active during development
All WSP_GGML_* defines Vestigial from an unrelated whisper project
-framework Accelerate/Metal/MetalKit Zero references in any source file
-lssl / -lcrypto Duplicates OpenSSL::SSL/OpenSSL::Crypto (BoringSSL via Conan)

Size-oriented release flags

MinSizeRel/Release: -Oz -ffunction-sections -fdata-sections + -Wl,-dead_strip

Build configuration mapping

  • build_fptn_lib.sh: Debug→Debug, Release/Measurement→MinSizeRel; unknown configs fail
  • Config-specific build dirs (build-ios-Debug, build-ios-MinSizeRel)
  • Build manifest (fptn_native_lib.build-manifest.json) beside the framework (not inside — written before codesign)
  • Cache identity: configuration + full fptn SHA + wrapper source hash + build-file hash (script, CMakeLists, conanfile, profiles, Info.plist.in) + compiler version

Swift/C++ interop

  • SWIFT_NONCOPYABLE on WebsocketSwiftBridge and SwiftApiClient

AGENTS.md

Updated stale architecture: no .mm files, SwiftApiClient not HttpsClientBridge, C++23 interop, correct bundle IDs.

Verification

Check Result
Measurement/MinSizeRel native build passed
codesign --verify --deep --strict passed
Unchanged source cache skip passed
Wrapper source change invalidation passed
Unknown configuration rejection passed
Xcode Debug build passed
Tests (22/22) passed

Stack

PR-1  Measurement safety          (base)
PR0   Production native build     ← this PR
PR1A  Native fixed baseline
PR1B  Queue and batch bounds
PR1C  Native teardown ownership
PR2   Wrapper/provider integration
PR3   C-based binary flight recorder

@mrmidi
mrmidi force-pushed the pr0/native-build branch 2 times, most recently from 99265de to a79229e Compare July 20, 2026 10:09
PR0 (Production-Like Native Build) — align the native build system
with production requirements and remove verified dead code.

C++23 (full stack):
- FptnLib/CMakeLists.txt: -std=c++23, cxx_std_23.
- project.yml + Tools/FptnCLI/project.yml: CLANG_CXX_LANGUAGE_STANDARD c++23.
- fptn submodule pinned to 7f52909 (C++23 + YAFF ranges patch).
  YAFF fix: C++23 libc++ ranges probes .begin() eagerly via
  input_or_output_iterator concept; patch defers BaseArray::begin/end
  to out-of-line definitions after ArrayIterator is fully defined.

Dead code removal (verified zero references):
- Remove -DO3 (preprocessor macro, not optimization flag).
- Remove unconditional -DNDEBUG (now Debug-only; assertions active).
- Remove all WSP_GGML_* defines (vestigial whisper project).
- Remove -framework Accelerate/Metal/MetalKit (zero references).
- Remove duplicate -lssl/-lcrypto (OpenSSL:: targets = BoringSSL).

Size-oriented release flags:
- MinSizeRel/Release: -Oz -ffunction-sections -fdata-sections
  with -Wl,-dead_strip.

Build configuration mapping:
- build_fptn_lib.sh: Debug→Debug, Release/Measurement→MinSizeRel.
- Config-specific build dirs + build manifest for stale detection.

Swift/C++ interop:
- SWIFT_NONCOPYABLE on WebsocketSwiftBridge and SwiftApiClient.

AGENTS.md: updated stale architecture docs.

Tests: 22/22 passed. Debug build succeeded.
@mrmidi
mrmidi force-pushed the pr0/native-build branch from a79229e to 9b21c13 Compare July 20, 2026 10:20
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.

1 participant