Download Bitstate/bitstate_poc_test_vectors_v3.json from mktnhr/BitState: direct link, hf CLI and curl.
- Browser
- Download file 57.3 kB
-
https://huggingface.co/datasets/mktnhr/BitState/resolve/main/Bitstate/bitstate_poc_test_vectors_v3.json
- Command line
-
hf download hf://datasets/mktnhr/BitState/Bitstate/bitstate_poc_test_vectors_v3.json
-
curl -L -o bitstate_poc_test_vectors_v3.json https://huggingface.co/datasets/mktnhr/BitState/resolve/main/Bitstate/bitstate_poc_test_vectors_v3.json
57.3 kB
{
"format": "BitState/HSDR correctness vectors v3 — direct 8-phase + histogram equivalence",
"lns8": {
"base_code": 74,
"codes_per_octave": 8,
"zero_code": 0,
"magnitude_formula": "2^((code-74)/8)",
"sign_encoding": "separate +/-1"
},
"q9_6_rounding": "round half away from zero after multiplying by 64",
"histogram_reconstruction": "R[p]=sum_o H[p][o]*2^o; S=scale*2^-9*sum_p R[p]*2^((p-2)/8)",
"cases": [
{
"name": "all_unity_positive",
"K": 128,
"scale": 1.0,
"notes": "All activations are +1.0, all ternary weights +1. Expected sum 128.",
"activation_codes": [
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74
],
"activation_signs": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
],
"ternary_weights": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
],
"expected_direct_fp64": 128.0,
"expected_histogram_fp64": 128.0,
"expected_abs_difference": 0.0,
"expected_q9_6_raw_lround": 8192,
"expected_q9_6_value_lround": 128.0,
"phase_integer_reduction_R": [
0,
0,
65536,
0,
0,
0,
0,
0
],
"state_domain_v2": {
"nonzero_signed_state_buckets": 1,
"balanced_global_tree_depth_upper_bound": 0,
"population_buckets": [
{
"code": 74,
"phase": 2,
"band": 9,
"signed_count": 128,
"sign": 1,
"population_log_offset_code_units": 56.0,
"fractional_lns_code": 130.0
}
],
"phase_fractional_lns_reference": [
{
"phase": 0,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 1,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 2,
"sign": 1,
"fractional_lns_code_unscaled": 130.0
},
{
"phase": 3,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 4,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 5,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 6,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 7,
"sign": 0,
"fractional_lns_code_unscaled": null
}
],
"expected_final_sign": 1,
"expected_final_fractional_lns_code": 130.0,
"expected_nearest_lns8_magnitude_code": 127,
"note": "fractional_lns_code fields are correctness references from exact math; runtime candidate uses count-log and kappa LUTs without linear materialization"
},
"expected_direct_8phase_accumulators": [
0,
0,
65536,
0,
0,
0,
0,
0
],
"direct_8phase_note": "Same 8 integers as histogram sum_o H[phase][o]<<o; intended as exact dyadic routing reference."
},
{
"name": "alternating_weight_cancel",
"K": 128,
"scale": 1.0,
"notes": "Exact cancellation with unit activations.",
"activation_codes": [
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74
],
"activation_signs": [
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1,
1
],
"ternary_weights": [
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1,
1,
-1
],
"expected_direct_fp64": 0.0,
"expected_histogram_fp64": 0.0,
"expected_abs_difference": 0.0,
"expected_q9_6_raw_lround": 0,
"expected_q9_6_value_lround": 0.0,
"phase_integer_reduction_R": [
0,
0,
0,
0,
0,
0,
0,
0
],
"state_domain_v2": {
"nonzero_signed_state_buckets": 0,
"balanced_global_tree_depth_upper_bound": 0,
"population_buckets": [],
"phase_fractional_lns_reference": [
{
"phase": 0,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 1,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 2,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 3,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 4,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 5,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 6,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 7,
"sign": 0,
"fractional_lns_code_unscaled": null
}
],
"expected_final_sign": 0,
"expected_final_fractional_lns_code": null,
"expected_nearest_lns8_magnitude_code": 0,
"note": "fractional_lns_code fields are correctness references from exact math; runtime candidate uses count-log and kappa LUTs without linear materialization"
},
"expected_direct_8phase_accumulators": [
0,
0,
0,
0,
0,
0,
0,
0
],
"direct_8phase_note": "Same 8 integers as histogram sum_o H[phase][o]<<o; intended as exact dyadic routing reference."
},
{
"name": "weight_zeros_and_signs",
"K": 128,
"scale": 0.75,
"notes": "Mixture of 0.5/2.0 activation magnitudes, signs, and zero ternary weights.",
"activation_codes": [
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82,
66,
82
],
"activation_signs": [
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
1
],
"ternary_weights": [
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0,
1,
-1,
0
],
"expected_direct_fp64": 79.125,
"expected_histogram_fp64": 79.125,
"expected_abs_difference": 0.0,
"expected_q9_6_raw_lround": 5064,
"expected_q9_6_value_lround": 79.125,
"phase_integer_reduction_R": [
0,
0,
54016,
0,
0,
0,
0,
0
],
"state_domain_v2": {
"nonzero_signed_state_buckets": 2,
"balanced_global_tree_depth_upper_bound": 1,
"population_buckets": [
{
"code": 66,
"phase": 2,
"band": 8,
"signed_count": 43,
"sign": 1,
"population_log_offset_code_units": 43.41011803761678,
"fractional_lns_code": 109.41011803761678
},
{
"code": 82,
"phase": 2,
"band": 10,
"signed_count": 42,
"sign": 1,
"population_log_offset_code_units": 43.138539382230086,
"fractional_lns_code": 125.13853938223008
}
],
"phase_fractional_lns_reference": [
{
"phase": 0,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 1,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 2,
"sign": 1,
"fractional_lns_code_unscaled": 127.76879350965748
},
{
"phase": 3,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 4,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 5,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 6,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 7,
"sign": 0,
"fractional_lns_code_unscaled": null
}
],
"expected_final_sign": 1,
"expected_final_fractional_lns_code": 124.44849351542673,
"expected_nearest_lns8_magnitude_code": 124,
"note": "fractional_lns_code fields are correctness references from exact math; runtime candidate uses count-log and kappa LUTs without linear materialization"
},
"expected_direct_8phase_accumulators": [
0,
0,
54016,
0,
0,
0,
0,
0
],
"direct_8phase_note": "Same 8 integers as histogram sum_o H[phase][o]<<o; intended as exact dyadic routing reference."
},
{
"name": "boundary_and_zero_codes",
"K": 128,
"scale": 0.125,
"notes": "Exercises code 0, minimum non-zero code 1, unity code 74, and maximum code 127.",
"activation_codes": [
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0,
1,
127,
74,
0
],
"activation_signs": [
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1
],
"ternary_weights": [
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1,
-1,
0,
1,
1
],
"expected_direct_fp64": 2.495970197075761,
"expected_histogram_fp64": 2.495970197075761,
"expected_abs_difference": 0.0,
"expected_q9_6_raw_lround": 160,
"expected_q9_6_value_lround": 2.5,
"phase_integer_reduction_R": [
0,
-18,
10240,
0,
0,
0,
0,
0
],
"state_domain_v2": {
"nonzero_signed_state_buckets": 2,
"balanced_global_tree_depth_upper_bound": 1,
"population_buckets": [
{
"code": 1,
"phase": 1,
"band": 0,
"signed_count": -18,
"sign": -1,
"population_log_offset_code_units": 33.3594000115385,
"fractional_lns_code": 34.3594000115385
},
{
"code": 74,
"phase": 2,
"band": 9,
"signed_count": 20,
"sign": 1,
"population_log_offset_code_units": 34.5754247590989,
"fractional_lns_code": 108.5754247590989
}
],
"phase_fractional_lns_reference": [
{
"phase": 0,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 1,
"sign": -1,
"fractional_lns_code_unscaled": 34.3594000115385
},
{
"phase": 2,
"sign": 1,
"fractional_lns_code_unscaled": 108.5754247590989
},
{
"phase": 3,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 4,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 5,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 6,
"sign": 0,
"fractional_lns_code_unscaled": null
},
{
"phase": 7,
"sign": 0,
"fractional_lns_code_unscaled": null
}
],
"expected_final_sign": 1,
"expected_final_fractional_lns_code": 84.5568056633843,
"expected_nearest_lns8_magnitude_code": 85,
"note": "fractional_lns_code fields are correctness references from exact math; runtime candidate uses count-log and kappa LUTs without linear materialization"
},
"expected_direct_8phase_accumulators": [
0,
-18,
10240,
0,
0,
0,
0,
0
],
"direct_8phase_note": "Same 8 integers as histogram sum_o H[phase][o]<<o; intended as exact dyadic routing reference."
},
{
"name": "phase_sweep_near_unity",
"K": 128,
"scale": 1.5,
"notes": "All 8 phases around unity are exercised repeatedly.",
"activation_codes": [
70,
71,
72,
73,
74,
75,
76,
77,
70,
71,
72,
73,
74,
75,
76,
77,
70,
71,
72,
73,
74,
75,
76,
77,
70,
71,
72,
73,
74,
75,
76,
77,
70,
71,
72,
73,
74,
75,
76,
77,
70,
71,
72,
73,
74,
75,
76,
77,
70,
71,
72,
73,
74,
75,
76,
77,
70,
71,
72,
73,
74,
75,
76,
77,
70,
71,
72,
73,
74,
75,
76,
77,
70,
71,
72,
73,
74,
75,
76,
77,
70,
71,
72,
73,
74,
75,
76,
77,
70,
71,
72,
73,
74,
75,
76,
77,
70,
71,
72,
73,
74,
75,
76,
77,
70,
71,
72,
73,
74,
75,
76,
77,
70,
71,
72,
73,
74,
75,
76,
77,
70,
71,
72,
73,
74,
75,
76,
77
],
"activation_signs": [
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
-1,
-1
],
"ternary_weights": [
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1,
1,
1,
0,
1,
1
],
"expected_direct_fp64": -15.863352201126354,
"expected_histogram_fp64": -15.863352201126357,
"expected_abs_difference": 3.552713678800501e-15,
"expected_q9_6_raw_lround": -1015,
"expected_q9_6_value_lround": -15.859375,
"phase_integer_reduction_R": [
-6656,
-6656,
6656,
6144,
-6656,
-6656,
3072,
3328
],
"state_domain_v2": {
"nonzero_signed_state_buckets": 8,
"balanced_global_tree_depth_upper_bound": 3,
"population_buckets": [
{
"code": 70,
"phase": 6,
"band": 8,
"signed_count": 12,
"sign": 1,
"population_log_offset_code_units": 28.67970000576925,
"fractional_lns_code": 98.67970000576925
},
{
"code": 71,
"phase": 7,
"band": 8,
"signed_count": 13,
"sign": 1,
"population_log_offset_code_units": 29.603517745128737,
"fractional_lns_code": 100.60351774512874
},
{
"code": 72,
"phase": 0,
"band": 9,
"signed_count": -13,
"sign": -1,
"population_log_offset_code_units": 29.603517745128737,
"fractional_lns_code": 101.60351774512874
},
{
"code": 73,
"phase": 1,
"band": 9,
"signed_count": -13,
"sign": -1,
"population_log_offset_code_units": 29.603517745128737,
"fractional_lns_code": 102.60351774512874
},
{
"code": 74,
"phase": 2,
"band": 9,
"signed_count": 13,
"sign": 1,
"population_log_offset_code_units": 29.603517745128737,
"fractional_lns_code": 103.60351774512874
},
{
"code": 75,
"phase": 3,
"band": 9,
"signed_count": 12,
"sign": 1,
"population_log_offset_code_units": 28.67970000576925,
"fractional_lns_code": 103.67970000576925
},
{
"code": 76,
"phase": 4,
"band": 9,
"signed_count": -13,
"sign": -1,
"population_log_offset_code_units": 29.603517745128737,
"fractional_lns_code": 105.60351774512874
},
{
"code": 77,
"phase": 5,
"band": 9,
"signed_count": -13,
"sign": -1,
"population_log_offset_code_units": 29.603517745128737,
"fractional_lns_code": 106.60351774512874
}
],
"phase_fractional_lns_reference": [
{
"phase": 0,
"sign": -1,
"fractional_lns_code_unscaled": 101.60351774512874
},
{
"phase": 1,
"sign": -1,
"fractional_lns_code_unscaled": 102.60351774512873
},
{
"phase": 2,
"sign": 1,
"fractional_lns_code_unscaled": 103.60351774512874
},
{
"phase": 3,
"sign": 1,
"fractional_lns_code_unscaled": 103.67970000576925
},
{
"phase": 4,
"sign": -1,
"fractional_lns_code_unscaled": 105.60351774512874
},
{
"phase": 5,
"sign": -1,
"fractional_lns_code_unscaled": 106.60351774512874
},
{
"phase": 6,
"sign": 1,
"fractional_lns_code_unscaled": 98.67970000576925
},
{
"phase": 7,
"sign": 1,
"fractional_lns_code_unscaled": 100.60351774512874
}
],
"expected_final_sign": -1,
"expected_final_fractional_lns_code": 105.90100611680009,
"expected_nearest_lns8_magnitude_code": 106,
"note": "fractional_lns_code fields are correctness references from exact math; runtime candidate uses count-log and kappa LUTs without linear materialization"
},
"expected_direct_8phase_accumulators": [
-6656,
-6656,
6656,
6144,
-6656,
-6656,
3072,
3328
],
"direct_8phase_note": "Same 8 integers as histogram sum_o H[phase][o]<<o; intended as exact dyadic routing reference."
},
{
"name": "deterministic_random_7408",
"K": 128,
"scale": 0.4375,
"notes": "Deterministic mixed-state vector, seed 7408.",
"activation_codes": [
0,
95,
96,
68,
77,
102,
20,
28,
104,
37,
33,
43,
78,
98,
37,
19,
81,
27,
52,
40,
89,
87,
72,
97,
34,
52,
91,
95,
51,
49,
52,
79,
0,
43,
52,
0,
29,
47,
29,
73,
77,
54,
41,
99,
30,
21,
46,
64,
105,
35,
36,
55,
104,
54,
19,
27,
95,
0,
48,
75,
106,
105,
48,
94,
30,
34,
86,
74,
79,
49,
102,
29,
80,
0,
78,
96,
49,
22,
92,
66,
61,
86,
48,
51,
64,
64,
101,
86,
32,
61,
0,
24,
57,
42,
62,
71,
57,
70,
83,
71,
44,
57,
95,
30,
100,
57,
50,
86,
82,
53,
24,
91,
94,
41,
81,
61,
82,
104,
95,
85,
42,
88,
106,
80,
92,
110,
79,
44
],
"activation_signs": [
-1,
1,
-1,
-1,
-1,
-1,
-1,
-1,
1,
1,
1,
-1,
-1,
1,
-1,
1,
1,
-1,
-1,
-1,
1,
1,
1,
-1,
1,
-1,
1,
1,
-1,
1,
1,
-1,
-1,
-1,
1,
1,
1,
-1,
-1,
1,
1,
1,
-1,
1,
-1,
-1,
1,
-1,
1,
-1,
-1,
1,
-1,
-1,
-1,
-1,
-1,
1,
-1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
1,
-1,
1,
1,
1,
1,
-1,
1,
-1,
1,
1,
1,
1,
-1,
-1,
-1,
1,
1,
-1,
-1,
1,
1,
1,
-1,
-1,
1,
1,
-1,
1,
1,
-1,
-1,
1,
1,
1,
1,
1,
1,
1,
-1,
-1,
1,
-1,
-1,
-1,
1,
-1,
1,
-1,
-1,
-1,
-1,
1,
-1,
-1,
-1,
1,
-1,
1,
1
],
"ternary_weights": [
1,
0,
1,
0,
1,
0,
0,
-1,
-1,
1,
1,
1,
-1,
-1,
1,
-1,
1,
1,
-1,
0,
1,
1,
1,
-1,
-1,
-1,
-1,
1,
1,
0,
-1,
1,
1,
-1,
1,
-1,
1,
1,
0,
1,
1,
-1,
-1,
1,
1,
-1,
1,
1,
1,
1,
0,
1,
1,
-1,
1,
-1,
0,
1,
-1,
-1,
1,
-1,
-1,
1,
-1,
-1,
0,
0,
-1,
-1,
1,
-1,
1,
1,
1,
1,
-1,
0,
1,
1,
-1,
0,
-1,
1,
1,
1,
-1,
1,
0,
-1,
1,
1,
-1,
0,
0,
-1,
0,
1,
-1,
1,
1,
0,
-1,
1,
0,
0,
1,
1,
1,
1,
1,
-1,
1,
-1,
-1,
0,
-1,
-1,
-1,
1,
1,
1,
1,
1,
1,
1,
-1,
-1
],
"expected_direct_fp64": 16.50192339368321,
"expected_histogram_fp64": 16.50192339368321,
"expected_abs_difference": 0.0,
"expected_q9_6_raw_lround": 1056,
"expected_q9_6_value_lround": 16.5,
"phase_integer_reduction_R": [
-9424,
25360,
-3776,
4456,
4232,
2884,
-5864,
1568
],
"state_domain_v2": {
"nonzero_signed_state_buckets": 44,
"balanced_global_tree_depth_upper_bound": 6,
"population_buckets": [
{
"code": 19,
"phase": 3,
"band": 2,
"signed_count": -2,
"sign": -1,
"population_log_offset_code_units": 8.0,
"fractional_lns_code": 27.0
},
{
"code": 21,
"phase": 5,
"band": 2,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 21.0
},
{
"code": 24,
"phase": 0,
"band": 3,
"signed_count": -2,
"sign": -1,
"population_log_offset_code_units": 8.0,
"fractional_lns_code": 32.0
},
{
"code": 28,
"phase": 4,
"band": 3,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 28.0
},
{
"code": 30,
"phase": 6,
"band": 3,
"signed_count": -1,
"sign": -1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 30.0
},
{
"code": 33,
"phase": 1,
"band": 4,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 33.0
},
{
"code": 34,
"phase": 2,
"band": 4,
"signed_count": -2,
"sign": -1,
"population_log_offset_code_units": 8.0,
"fractional_lns_code": 42.0
},
{
"code": 35,
"phase": 3,
"band": 4,
"signed_count": -1,
"sign": -1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 35.0
},
{
"code": 42,
"phase": 2,
"band": 5,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 42.0
},
{
"code": 46,
"phase": 6,
"band": 5,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 46.0
},
{
"code": 47,
"phase": 7,
"band": 5,
"signed_count": -1,
"sign": -1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 47.0
},
{
"code": 48,
"phase": 0,
"band": 6,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 48.0
},
{
"code": 49,
"phase": 1,
"band": 6,
"signed_count": 2,
"sign": 1,
"population_log_offset_code_units": 8.0,
"fractional_lns_code": 57.0
},
{
"code": 50,
"phase": 2,
"band": 6,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 50.0
},
{
"code": 51,
"phase": 3,
"band": 6,
"signed_count": -2,
"sign": -1,
"population_log_offset_code_units": 8.0,
"fractional_lns_code": 59.0
},
{
"code": 52,
"phase": 4,
"band": 6,
"signed_count": 2,
"sign": 1,
"population_log_offset_code_units": 8.0,
"fractional_lns_code": 60.0
},
{
"code": 53,
"phase": 5,
"band": 6,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 53.0
},
{
"code": 55,
"phase": 7,
"band": 6,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 55.0
},
{
"code": 57,
"phase": 1,
"band": 7,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 57.0
},
{
"code": 61,
"phase": 5,
"band": 7,
"signed_count": -2,
"sign": -1,
"population_log_offset_code_units": 8.0,
"fractional_lns_code": 69.0
},
{
"code": 64,
"phase": 0,
"band": 8,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 64.0
},
{
"code": 66,
"phase": 2,
"band": 8,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 66.0
},
{
"code": 70,
"phase": 6,
"band": 8,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 70.0
},
{
"code": 72,
"phase": 0,
"band": 9,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 72.0
},
{
"code": 73,
"phase": 1,
"band": 9,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 73.0
},
{
"code": 75,
"phase": 3,
"band": 9,
"signed_count": -1,
"sign": -1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 75.0
},
{
"code": 79,
"phase": 7,
"band": 9,
"signed_count": -3,
"sign": -1,
"population_log_offset_code_units": 12.679700005769249,
"fractional_lns_code": 91.67970000576925
},
{
"code": 81,
"phase": 1,
"band": 10,
"signed_count": 2,
"sign": 1,
"population_log_offset_code_units": 8.0,
"fractional_lns_code": 89.0
},
{
"code": 83,
"phase": 3,
"band": 10,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 83.0
},
{
"code": 85,
"phase": 5,
"band": 10,
"signed_count": -1,
"sign": -1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 85.0
},
{
"code": 86,
"phase": 6,
"band": 10,
"signed_count": -2,
"sign": -1,
"population_log_offset_code_units": 8.0,
"fractional_lns_code": 94.0
},
{
"code": 87,
"phase": 7,
"band": 10,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 87.0
},
{
"code": 88,
"phase": 0,
"band": 11,
"signed_count": -1,
"sign": -1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 88.0
},
{
"code": 89,
"phase": 1,
"band": 11,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 89.0
},
{
"code": 92,
"phase": 4,
"band": 11,
"signed_count": 2,
"sign": 1,
"population_log_offset_code_units": 8.0,
"fractional_lns_code": 100.0
},
{
"code": 95,
"phase": 7,
"band": 11,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 95.0
},
{
"code": 97,
"phase": 1,
"band": 12,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 97.0
},
{
"code": 98,
"phase": 2,
"band": 12,
"signed_count": -1,
"sign": -1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 98.0
},
{
"code": 99,
"phase": 3,
"band": 12,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 99.0
},
{
"code": 101,
"phase": 5,
"band": 12,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 101.0
},
{
"code": 102,
"phase": 6,
"band": 12,
"signed_count": 1,
"sign": 1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 102.0
},
{
"code": 104,
"phase": 0,
"band": 13,
"signed_count": -1,
"sign": -1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 104.0
},
{
"code": 105,
"phase": 1,
"band": 13,
"signed_count": 2,
"sign": 1,
"population_log_offset_code_units": 8.0,
"fractional_lns_code": 113.0
},
{
"code": 110,
"phase": 6,
"band": 13,
"signed_count": -1,
"sign": -1,
"population_log_offset_code_units": 0.0,
"fractional_lns_code": 110.0
}
],
"phase_fractional_lns_reference": [
{
"phase": 0,
"sign": -1,
"fractional_lns_code_unscaled": 105.61699059064368
},
{
"phase": 1,
"sign": 1,
"fractional_lns_code_unscaled": 118.04213700021415
},
{
"phase": 2,
"sign": -1,
"fractional_lns_code_unscaled": 97.06114439489473
},
{
"phase": 3,
"sign": 1,
"fractional_lns_code_unscaled": 99.97226813872025
},
{
"phase": 4,
"sign": 1,
"fractional_lns_code_unscaled": 100.37699129691221
},
{
"phase": 5,
"sign": 1,
"fractional_lns_code_unscaled": 96.95084359392658
},
{
"phase": 6,
"sign": -1,
"fractional_lns_code_unscaled": 106.14135510507049
},
{
"phase": 7,
"sign": 1,
"fractional_lns_code_unscaled": 91.91767875292166
}
],
"expected_final_sign": 1,
"expected_final_fractional_lns_code": 106.35649826822939,
"expected_nearest_lns8_magnitude_code": 106,
"note": "fractional_lns_code fields are correctness references from exact math; runtime candidate uses count-log and kappa LUTs without linear materialization"
},
"expected_direct_8phase_accumulators": [
-9424,
25360,
-3776,
4456,
4232,
2884,
-5864,
1568
],
"direct_8phase_note": "Same 8 integers as histogram sum_o H[phase][o]<<o; intended as exact dyadic routing reference."
}
],
"reduction_model": {
"core_principle": "move reduction into the state domain to break serial arithmetic dependency",
"reference_path": "signed state histogram -> dyadic integer shift/add -> wide fixed/Q9.6 optional",
"pure_lns_path": "signed state histogram -> count-to-log fold -> fractional-LNS balanced add/sub -> scale log offset -> LNS8",
"population_fold": "lambda_bucket = code + 8*log2(abs(signed_count)); sign = sign(signed_count)",
"same_sign_add": "out=max(a,b)+8*log2(1+2^(-abs(a-b)/8))",
"opposite_sign_add": "out=max(a,b)+8*log2(1-2^(-abs(a-b)/8)); equal magnitudes cancel to zero",
"anchor_identity": "code = (120 + phase) + 8*(band - 15); code122 is exact 64",
"final_phase_tree": "8 -> 4 -> 2 -> 1 balanced reduction"
},
"direct_8phase_reduction": {
"excel_reference": "LNS8_base74_8step_zone8_popcount_demo_JA_v0.8_bitslice128_validation.xlsx",
"product_layout": "S1|E4|L3",
"formula": "A[L3] += sign * (1 << E4)",
"final_formula": "S=scale*2^-9*sum_p A[p]*2^((p-2)/8)",
"correctness_invariant": "direct decoded sum == direct A[0..7] reconstruction == histogram-derived A[0..7] reconstruction",
"note": "phase masks are intermediate routing selectors; POPCOUNT is optional for the direct dyadic path"
}
}
{
"format": "BitState/HSDR correctness vectors v3 — direct 8-phase + histogram equivalence",
"lns8": {
"base_code": 74,
"codes_per_octave": 8,
"zero_code": 0,
"magnitude_formula": "2^((code-74)/8)",
"sign_encoding": "separate +/-1"
},
"q9_6_rounding": "round half away from zero after multiplying by 64",
"histogram_reconstruction": "R[p]=sum_o H[p][o]*2^o; S=scale*2^-9*sum_p R[p]*2^((p-2)/8)",
"cases": [
{
"name": "all_unity_positive",
"K": 128,
"scale": 1.0,
"notes": "All activations are +1.0, all ternary weights +1. Expected sum 128.",
"activation_codes": [
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,
74,