Skip to content

core: add CFL atomics and API hardening#76

Merged
edsiper merged 10 commits into
masterfrom
atomic
May 12, 2026
Merged

core: add CFL atomics and API hardening#76
edsiper merged 10 commits into
masterfrom
atomic

Conversation

@edsiper
Copy link
Copy Markdown
Member

@edsiper edsiper commented May 11, 2026

Port the cmetrics atomic operations interface to CFL with cfl_atomic_* names and wire it into the build with compiler-specific backends for GCC, Clang, and MSVC, plus a pthread-based fallback.

This PR also hardens public API input validation, expands regression coverage, documents the top-level CFL interfaces, and updates repository/CI maintenance files needed for the new coverage to run reliably.

Changes:

  • Add the cfl_atomic_* API and backend selection logic.
  • Add tests for load, store, compare-exchange, and threaded increments.
  • Harden core public API behavior around invalid inputs.
  • Expand README.md coverage for the library’s top-level interfaces.
  • Add repository guidance in AGENTS.md.
  • Fix CI coverage for Debian Buster archive mirrors, supported Windows runners,
    and code-analysis workflow wiring.

Validation:

  • Added unit coverage for the new atomics interface.
  • Verified workflow linting with actionlint.
  • Confirmed Debian Buster downstream coverage still applies based on Fluent Bit
    packaging targets.

edsiper added 5 commits May 11, 2026 14:03
Port the cmetrics atomic operation interface to CFL with cfl_atomic_* names.

Add compiler-specific backends for GCC, Clang, and MSVC, plus a pthread-based generic fallback.

Wire the selected backend into the CFL build and add coverage for load, store, compare-exchange, and threaded increments.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Add project-specific agent instructions for CFL build, test, style, commit, and worktree practices.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Add tests for repeated initialization and full-width uint64_t values across load, store, and compare-exchange operations.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Expand the README with an overview of CFL core APIs, data structures, utility modules, support headers, and basic build/test commands.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Reject invalid SDS lengths, guard allocation arithmetic, and make variant printing size-aware for referenced strings and bytes.

Add NULL-input handling across public containers and utility helpers, make public headers self-contained, and add regression coverage for the hardened paths.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
edsiper added 2 commits May 11, 2026 14:07
Use archive.debian.org for the legacy Buster container so apt-get update can still resolve archived package metadata.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
@edsiper edsiper changed the title atomic: add atomic operations API core: add CFL atomics and API hardening May 11, 2026
@edsiper edsiper marked this pull request as ready for review May 11, 2026 20:20
Reject recursive container ownership patterns that can create cycles or leave objects pointing at owned children.

Make variant printing JSON-safe for references and non-finite doubles, propagate array/kvlist print errors, and fix kvlist key matching/removal semantics.

Tighten SDS in-buffer append bounds and add regression coverage for ownership, JSON output, print failures, and SDS overlap handling.

Keep the private container helper declarations under include/cfl with the rest of the CFL headers.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
edsiper added 2 commits May 11, 2026 15:39
Avoid deep container graph walks for primitive variants while preserving duplicate variant ownership checks.

Add array and kvlist regressions for inserting the same primitive variant pointer twice.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
Use EOF checks for variant print paths that write null via fputs because fputs only guarantees a non-negative value on success.

Signed-off-by: Eduardo Silva <eduardo@chronosphere.io>
@edsiper edsiper enabled auto-merge (rebase) May 12, 2026 01:09
@edsiper edsiper disabled auto-merge May 12, 2026 01:10
@edsiper edsiper merged commit b4cdb62 into master May 12, 2026
22 checks passed
@edsiper edsiper deleted the atomic branch May 12, 2026 01:14
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