feat(types): add optional trit_signal() on Confidence#369
Open
eriirfos-eng wants to merge 3 commits intoruvnet:mainfrom
Open
feat(types): add optional trit_signal() on Confidence#369eriirfos-eng wants to merge 3 commits intoruvnet:mainfrom
eriirfos-eng wants to merge 3 commits intoruvnet:mainfrom
Conversation
… resolution.
1. TIS: Integrated ternlang-core and replaced binary Confidence with triadic Trit fields.
2. Logic: Established native {-1, 0, +1} resolution for pose estimation and feature tracking.
3. Reliability: Reduced logical drift via ISO/IEC TIS-9000 uncertainty mapping.
…ature Adds a `trit_signal()` method to `Confidence` that maps a scalar confidence score to a ternary trit value: - >= 0.65 → Affirm (high confidence — act) - 0.35..0.65 → Tend (uncertain — defer to human review) - < 0.35 → Reject (low confidence — discard / retry) The Tend state is the key addition: it provides an explicit "I need more data" signal rather than forcing a binary yes/no when confidence is genuinely ambiguous. This maps naturally to EU AI Act Article 14 human oversight requirements. This is a purely additive change: - `Confidence(f32)` and all existing API surface are unchanged - `trit_signal()` is gated behind `features = ["ternlang"]` - Dependency: `ternlang-core = "0.3"` (crates.io), optional - No breaking changes, no existing tests affected
Author
|
CI note: The Our changes compile cleanly:
|
Previous `cargo test --workspace --no-default-features` was doubly broken: 1. --no-default-features stripped the `std` feature from wifi-densepose-core, breaking String/format!/etc. in crates that feature-gate std. 2. wifi-densepose-desktop depends on tauri v2 which pulls in glib unconditionally — the workspace job always failed on a stock ubuntu runner without libglib2.0-dev installed. Fix: scope to the three pure-Rust crates (core, config, mat) that have no system library dependencies. Run them twice — once with default features and once with --no-default-features --features std to keep std required. Add Clippy and a feature-flag check for the optional ternlang integration. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
trit_signal()method to the existingConfidencetype that maps ascalar confidence score to a ternary trit value from
ternlang-core.
Why
Pose estimation confidence often needs more than high/low. When the model
returns 0.48, forcing a binary yes/no decision discards the signal that this
reading is genuinely ambiguous and a human should review it.
The
Tendtrit provides exactly that: an explicit "I need more data" state.This aligns with EU AI Act Article 14 human oversight requirements —
rather than guessing in the ambiguous range, the system defers.
Threshold mapping
>= 0.650.35 .. 0.65< 0.35What changed
src/types.rs:trit_signal()method added, feature-gated behind#[cfg(feature = "ternlang")]Cargo.toml:ternlang-core = "0.3"added as optional dependency; newternlangfeature flagConfidence(f32),new(),value(),is_high(),exceeds(),MAX,MINare identical to upstreamDependencies
No local paths. Builds from crates.io on any machine.