Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Binary file not shown.
2 changes: 1 addition & 1 deletion crates/thinking-engine/src/awareness_dto.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//! MomentDto — complete snapshot: resonance + qualia + agent state
//! ```

use crate::meaning_axes::{HdrResonance, Archetype, AxisActivation, Viscosity, CouncilWeights};
use crate::meaning_axes::{HdrResonance, Archetype, AxisActivation, Viscosity};
use crate::cognitive_stack::{ThinkingStyle, GateState, RungLevel};
use crate::ghosts::GhostType;

Expand Down
2 changes: 1 addition & 1 deletion crates/thinking-engine/src/cognitive_trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
//! Every computation step is recorded. The trace IS the thought.
//! Reproducible, debuggable, replayable.

use crate::domino::{StageResult, DissonanceProfile};
use crate::domino::StageResult;
use crate::superposition::{SuperpositionField, ThinkingStyle};
use crate::qualia::Qualia17D;

Expand Down
4 changes: 2 additions & 2 deletions crates/thinking-engine/src/contract_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! The CollapseGate from the planner controls cascade termination.

use crate::cognitive_stack::{self, GateState, RungLevel};
use crate::meaning_axes::{Viscosity, CouncilWeights, Archetype, VolitionalAct};
use crate::meaning_axes::{Viscosity, CouncilWeights, Archetype};

/// Map contract's 36 styles to the engine's 12 styles.
/// The 36 are grouped into 6 clusters of 6. Each cluster maps to
Expand Down Expand Up @@ -68,7 +68,7 @@ impl CascadeConfig {
style_id: u8,
rung: RungLevel,
sd: f32,
free_energy: f32,
_free_energy: f32,
) -> Self {
let style = contract_style_to_engine(style_id);
let params = style.params();
Expand Down
2 changes: 1 addition & 1 deletion crates/thinking-engine/src/domino.rs
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ impl<'a> DominoCascade<'a> {
.map(|(_, v)| { let d = *v as f32 - mean; d * d })
.sum::<f32>() / above_floor.len() as f32;
let std = variance.sqrt().max(0.1);
let threshold_3sigma = mean + 3.0 * std;
let _threshold_3sigma = mean + 3.0 * std;

for &(j, val) in &above_floor {
let freq = (val as f32 - floor as f32) / (255.0 - floor as f32);
Expand Down
2 changes: 1 addition & 1 deletion crates/thinking-engine/src/ground_truth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#[cfg(feature = "calibration")]
pub mod calibration {
use crate::tokenizer_registry::{ModelId, TokenizerRegistry};
use crate::tokenizer_registry::ModelId;

/// Ground truth embedding for one text.
#[derive(Clone, Debug)]
Expand Down
2 changes: 1 addition & 1 deletion crates/thinking-engine/src/pooling.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fn pool_mean(energy: &[f32], threshold: f32) -> PooledResult {

let total: f32 = energy.iter().sum();
let active_sum: f32 = active.iter().map(|(_, e)| e).sum();
let mean_energy = active_sum / active.len() as f32;
let _mean_energy = active_sum / active.len() as f32;

// Compute entropy of active atoms
let mut entropy = 0.0f32;
Expand Down
2 changes: 1 addition & 1 deletion crates/thinking-engine/src/role_tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
//! The 33% correction lives HERE — raw Up vs silu(gate)×Up.

use crate::bf16_engine::BF16ThinkingEngine;
use bgz_tensor::stacked_n::{StackedN, ClamCodebook, bf16_to_f32, f32_to_bf16};
use bgz_tensor::stacked_n::{ClamCodebook, bf16_to_f32};
use ndarray::hpc::heel_f64x8::cosine_f32_to_f64_simd;

/// SiLU activation: x / (1 + exp(-x))
Expand Down
2 changes: 1 addition & 1 deletion crates/thinking-engine/src/sensor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//!
//! No HTTP, no GGUF, no I/O — just activation logic.

use crate::engine::{ThinkingEngine, CODEBOOK_SIZE};
use crate::engine::ThinkingEngine;
use ndarray::hpc::heel_f64x8::cosine_f32_to_f64_simd;

/// A single sensor that activates specific codebook atoms with weights.
Expand Down
5 changes: 1 addition & 4 deletions crates/thinking-engine/src/signed_domino.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
//! the signed cascade has a NATURAL zero point: the sign IS the gate.

use crate::signed_engine::SignedThinkingEngine;
use crate::layered::CausalEdge64;
use crate::domino::{CascadeAtom, StageResult, CognitiveMarkers, DissonanceProfile,
Transition, CH_SUPPORTS, CH_CAUSES, CH_GROUNDS, CH_RELATES,
CH_REFINES, CH_ABSTRACTS, CH_BECOMES, CH_CONTRADICTS};
use crate::domino::{CascadeAtom, StageResult, CognitiveMarkers};

/// Signed domino cascade engine.
pub struct SignedDominoCascade<'a> {
Expand Down
2 changes: 1 addition & 1 deletion crates/thinking-engine/src/spiral_segment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ impl SpiralRow {
// Try increasingly large segments from this start
let mut best_end = start + 1;
for end in (start + 2)..=values.len() {
let (seg, err) = SpiralSegment::fit(&values[start..end]);
let (_seg, err) = SpiralSegment::fit(&values[start..end]);
if err > max_error {
break;
}
Expand Down
4 changes: 2 additions & 2 deletions crates/thinking-engine/src/superposition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ pub fn compute_superposition(
// Collect all atoms that appear in ANY lens
let mut all_atoms: HashMap<u16, Vec<u32>> = HashMap::new();
for visits in lens_visits {
for (&atom, &count) in *visits {
for (&atom, &_count) in *visits {
all_atoms.entry(atom).or_insert_with(|| vec![0; lens_visits.len()]);
}
}
Expand Down Expand Up @@ -150,7 +150,7 @@ pub fn detect_style(
avg_dissonance: f32,
thresholds: &StyleThresholds,
) -> ThinkingStyle {
let resonant_fraction = field.n_resonant as f32 / n_atoms.max(1) as f32;
let _resonant_fraction = field.n_resonant as f32 / n_atoms.max(1) as f32;

// Gate: only count atoms above threshold
let gated_count = field.resonant_atoms.iter()
Expand Down
4 changes: 2 additions & 2 deletions crates/thinking-engine/src/tensor_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl EmbeddingOutput {
EmbeddingOutput::I8(v) => v.iter().map(|&x| x as f32 / 127.0).collect(),
EmbeddingOutput::U8(v) => v.iter().map(|&x| (x as f32 - 128.0) / 127.0).collect(),
#[cfg(feature = "calibration")]
EmbeddingOutput::Tensor(t) => {
EmbeddingOutput::Tensor(_t) => {
t.flatten_all()
.and_then(|t| t.to_vec1::<f32>())
.unwrap_or_default()
Expand All @@ -50,7 +50,7 @@ impl EmbeddingOutput {
.map(|&x| (x as i16 - 128) as i8)
.collect(),
#[cfg(feature = "calibration")]
EmbeddingOutput::Tensor(t) => {
EmbeddingOutput::Tensor(_t) => {
self.to_f32().iter()
.map(|&x| (x * 127.0).round().clamp(-128.0, 127.0) as i8)
.collect()
Expand Down
4 changes: 2 additions & 2 deletions crates/thinking-engine/src/world_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
//! }
//! ```

use crate::cognitive_stack::{ThinkingStyle, GateState, RungLevel};
use crate::cognitive_stack::{ThinkingStyle, GateState};
use crate::meaning_axes::{HdrResonance, Archetype, Viscosity};
use crate::ghosts::GhostType;

Expand Down Expand Up @@ -180,7 +180,7 @@ impl WorldModelDto {
GestaltState::Dissolving
};

let (primary, p_dist) = qualia.nearest_family();
let (primary, _p_dist) = qualia.nearest_family();
let (_, _, blend_name, _) = qualia.emotional_blend();
let overlay = blend_name.split(" + ").nth(1)
.and_then(|s| s.split(" = ").next())
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"model": "jina-reranker-v3-BF16",
"source_gguf": "jina-reranker-v3-BF16.gguf",
"n_centroids": 256,
"vocab_size": 151936,
"hidden_dim": 1024,
"cosine_range": [
-0.886179,
0.825638
],
"cosine_mean": 0.005075,
"encoding_lanes": {
"lane_1_u8_cdf": {
"file": "distance_table_256x256.u8",
"encoding": "CDF_percentile",
"metadata_bytes": 0,
"note": "pure rank, no decode metadata needed"
},
"lane_2_i8_direct": {
"file": "distance_table_256x256.i8",
"encoding": "round(cos * 127)",
"scale": 127.0,
"note": "signs preserved from f32 cosine"
},
"lane_3_u8_gamma_phi": {
"file": "distance_table_256x256.gamma_phi.u8",
"encoding": "gamma_phi_CDF",
"role_gamma": 0.191019,
"phi_scale": 0.886179,
"note": "golden ratio redistribution, auto-calibrated gamma from cosine distribution"
},
"lane_4_i8_gamma_phi_signed": {
"file": "distance_table_256x256.gamma_phi.i8",
"encoding": "gamma_phi_signed",
"role_gamma": 0.191019,
"phi_scale": 0.886179,
"note": "gamma+phi on signed range, signs preserved"
},
"lane_5_silu_correction": {
"file": "silu_deltas_256x256.f32",
"encoding": "f32_delta",
"note": "cos(silu(gate)*up) - cos(raw). Zero for token_embd (no gate)."
},
"lane_6_bf16_direct": {
"file": "distance_table_256x256.bf16",
"encoding": "f32_to_bf16_truncate",
"max_roundtrip_error": 0.0039
},
"lane_7_spiral_drift": {
"file": "spiral_drift_256x256.u8",
"encoding": "neighbor_correlation_drift",
"stride": 11,
"avg_drift": 0.71282,
"max_drift": 1.666678
}
},
"ei_ratio": 0.5022,
"positive_pairs": 16392,
"negative_pairs": 15822,
"zero_pairs": 426
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.