Skip to content

Release v0.24.0#80

Merged
sebastient merged 2 commits into
mainfrom
release/0.24.0
May 25, 2026
Merged

Release v0.24.0#80
sebastient merged 2 commits into
mainfrom
release/0.24.0

Conversation

@sebastient
Copy link
Copy Markdown
Contributor

Summary

Release v0.24.0 bundles two C API improvements alongside the version bump:

  • hal_tensor_set_quantization(tensor, scale, zero_point) — new C symbol mirroring the Rust TensorDyn::set_quantization contract. Required when wrapping framework buffers (e.g. NNStreamer GstMemory outputs) that carry no quant of their own before feeding them to a schema-driven hal_decoder_decode_proto() call. Float tensors reject with EINVAL.

  • Decoder errno mapping rewritten. hal_decoder_decode{,_proto,_tracked} previously collapsed every DecoderError variant to EIO, masking caller-side preconditions as "internal" faults. A new errno_for_decoder_error() mapper splits them:

    • EINVAL (caller input is malformed/incomplete): InvalidShape, InvalidConfig, NoConfig, DtypeMismatch, QuantMissing, Yaml, Json, NotSupported, NDArrayShape.
    • EIO (internal/library fault the caller cannot fix): Internal, KernelDispatchUnreachable, ForcedKernelUnavailable.

    Notably, missing per-tensor quantization on integer decoder inputs now surfaces as EINVAL instead of EIO — operators triaging GStreamer / NNStreamer pipelines can read the upstream wiring bug directly rather than as a hardware/library failure.

See CHANGELOG.md [0.24.0] section for the full entry.

Pre-flight checks

Run locally on this branch (make verify-version sbom format lint):

  • verify-version ✓ — workspace 0.24.0 matches crates/python/pyproject.toml and CHANGELOG.md
  • format ✓ — rustfmt clean; one ruff line-length reformat in tests/test_tensor.py (pre-existing drift, included)
  • lint ✓ — clippy strict-mode + ruff both clean
  • sbom ✓ — 262 components, license policy compliant, NOTICE regenerated

Test plan

  • CI green on release/0.24.0
  • Verify hal_tensor_set_quantization symbol exported and consumable from a downstream C harness
  • Confirm a deliberately-quant-less integer decoder input now returns -1 with errno == EINVAL (was EIO on 0.23.2)
  • 2 approvals collected before merge to main
  • After merge: tag v0.24.0 from main with -s

Signed-off-by: Sébastien Taylor <[email protected]>
Copilot AI review requested due to automatic review settings May 25, 2026 20:59
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Release v0.24.0 updates workspace/package versions and delivers two C API improvements: a new tensor quantization setter and more informative errno mapping for decoder failures.

Changes:

  • Add hal_tensor_set_quantization() to attach per-tensor affine quantization metadata to integer tensors via the C API.
  • Rewrite hal_decoder_decode{,_proto,_tracked} error handling to map DecoderError variants to EINVAL vs EIO (caller preconditions vs internal faults).
  • Bump versions to 0.24.0 across Cargo workspace, Python pyproject.toml, Cargo.lock, NOTICE, and add the 0.24.0 changelog entry.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_tensor.py Ruff-driven formatting adjustment for an existing skip marker.
NOTICE Regenerated/updated attribution versions to 0.24.0.
crates/python/pyproject.toml Bump Python package version to 0.24.0.
crates/capi/src/tensor.rs Add hal_tensor_set_quantization() C entry point and Rust-side docs.
crates/capi/src/decoder.rs Add errno_for_decoder_error() and apply it to decoder C entry points; update docs.
crates/capi/include/edgefirst/hal.h Expose hal_tensor_set_quantization() and update decoder errno documentation in the public header.
CHANGELOG.md Add 0.24.0 release notes describing the new C API symbol and errno behavior change.
Cargo.toml Bump workspace/package version and internal crate versions to 0.24.0.
Cargo.lock Update locked workspace crate versions to 0.24.0.

Comment thread crates/capi/src/tensor.rs
Comment thread crates/capi/include/edgefirst/hal.h Outdated
@github-actions
Copy link
Copy Markdown

Test Results (x86_64)

162 tests  ±0   150 ✅ ±0   1m 25s ⏱️ -1s
  1 suites ±0    12 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit a23b375. ± Comparison against base commit 6773839.

@github-actions
Copy link
Copy Markdown

Test Results (aarch64)

1 252 tests  ±0   1 240 ✅ ±0   43s ⏱️ +2s
    2 suites ±0      12 💤 ±0 
    2 files   ±0       0 ❌ ±0 

Results for commit a23b375. ± Comparison against base commit 6773839.

@sonarqubecloud
Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
25.0% Coverage on New Code (required ≥ 50%)

See analysis details on SonarQube Cloud

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Comment thread crates/capi/src/tensor.rs
Comment on lines +757 to +777
/// The C boundary actively validates inputs (the Rust constructor
/// `Quantization::per_tensor` and `TensorDyn::set_quantization` do not):
///
/// - `scale` must be finite and strictly positive. NaN, ±∞, zero, and
/// negative values are rejected with `EINVAL`. (Some training tooling
/// permits negative scales as a mathematical equivalence, but real
/// runtime kernels in this codebase assume `scale > 0`.)
/// - `zero_point` must fit the tensor's integer dtype range
/// (`u8: 0..=255`, `i8: -128..=127`, `u16: 0..=65535`, `i16:
/// -32768..=32767`, `u32/u64: >= 0`, `i32/i64`: any `int`). Out-of-range
/// values are rejected with `EINVAL`.
/// - Float tensors reject quantization with `EINVAL`. This mirrors the
/// Rust `TensorDyn::set_quantization` contract.
///
/// @param tensor Tensor handle (must be an integer dtype)
/// @param scale Quantization scale (must be finite and > 0)
/// @param zero_point Quantization zero-point (must fit the tensor dtype)
/// @return 0 on success, -1 on error
/// @par Errors (errno):
/// - EINVAL: NULL tensor, float dtype, non-finite/non-positive scale,
/// or zero_point out of range for the tensor's integer dtype
Comment thread crates/capi/include/edgefirst/hal.h
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 8 out of 9 changed files in this pull request and generated 2 comments.

Comment thread crates/capi/src/tensor.rs
Comment thread crates/capi/src/tensor.rs
@sebastient sebastient merged commit 0eeab5b into main May 25, 2026
8 of 16 checks passed
@sebastient sebastient deleted the release/0.24.0 branch May 25, 2026 21:59
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.

2 participants