Source identity
| Field | Recorded value |
|---|---|
| Source type | archive member |
| Original record | independent_formula_checks.py |
| Date | Not specified in source |
| Path or archive member | archives/libsrc-6dbbf2af4e13/independent_formula_checks.py |
| Original SHA-256 | 662bc5ff6ed01a9d8ab5990e382d148ccb6a28537f39c3cbde19cd4e43e5d217 |
| Reading-copy SHA-256 | 662bc5ff6ed01a9d8ab5990e382d148ccb6a28537f39c3cbde19cd4e43e5d217 |
| Archive source | {"sourceId": "libsrc-6dbbf2af4e13", "member": "independent_formula_checks.py"} |
Recovered source transcript
Download complete source text ↓140 lines · 5.4 KB
#!/usr/bin/env python3
"""Independent formula counterexamples for the 2026-09-15 GitHub review.
These are small Python reproductions of inspected formulas, NOT execution of
any repository's source files, build, deployment, or original test suite.
Uses Python 3 standard library only; no network, credentials, or host changes.
Run: python3 independent_formula_checks.py
"""
from __future__ import annotations
import json
import math
PHI = (1 + math.sqrt(5)) / 2
DELTA = 0.013618
def softsign(x: float) -> float:
return x / (1 + abs(x))
def normalizer(values: list[float]) -> float:
return 1 / (1 + sum(x * x for x in values) / PHI)
def gate_first_tick() -> dict:
"""Compare zero-state first ticks, not compression or measured throughput."""
phase_dna = DELTA % 1
phase_fib = (1 / PHI) % 1
threshold = ((phase_dna + phase_fib) / 2) * 1000
repo_output = [int(i % 1000 < threshold) for i in range(5000)]
plan_flip = int((phase_dna + phase_fib) % 1 > 0.5)
plan_output = [plan_flip] * 5000
assert sum(repo_output) == 1580
assert sum(plan_output) == 5000
return {
"initial_conditions": "5,000 zero gates, zero phases, zero input",
"repository_rule_ones": sum(repo_output),
"rebuild_plan_rule_ones": sum(plan_output),
"differing_gate_positions": sum(a != b for a, b in zip(repo_output, plan_output)),
"interpretation": "Different transition rules; neither is chosen as canonical by this check.",
}
def consciousness_output() -> float:
"""Reproduce ConsciousnessEngine.evaluate(), which has no state input."""
previous = 0.5
core: list[float] = []
for i in range(174):
value = 0.5 + 0.5 * math.sin(2 * math.pi * (i / 174) * PHI) * previous
core.append(value)
previous = value
supplemental = [core[i % 174] * math.cos((i / 200) * math.pi) for i in range(200)]
return sum(core + supplemental) / 374
def meta_state_order() -> dict:
"""Compare operation order with explicitly equal, controlled parameters.
The parameters below are a diagnostic setup, NOT a claim that every C++
deployment uses these values. Formula definitions are taken from inspected
C++ build_families/update_meta_state and JS families/MetaState.step.
"""
cur = [0.1] * 16
prev = [0.1] * 16
dx, err, utility, stability = 0.3, 0.1, 0.6, 0.8
gamma_min = 0.1
gamma = gamma_min + (1 - gamma_min) * stability
rho = 1 / (1 + PHI)
x = 0.1
family_outputs = [
x + 0.1 * (dx - x),
0.9 * x + 0.1 * utility,
x + 0.05 * (softsign(dx) - x),
x + 0.2 * softsign(utility - x),
max(0, min(1, (x + utility) / (1 + abs(utility)))),
x + 0.1 * dx,
0.5 * (x + 1 / (1 + math.exp(-dx))),
x - 0.05 * err + 0.05 * utility,
0.95 * x + 0.05 * dx,
x + 0.05 * softsign(dx - x),
(1 - rho) * x + rho * dx,
x - 0.05 * abs(dx) + 0.05 * utility,
x - 0.05 * abs(dx),
x + 0.02 * (dx + utility),
x + 0.15 * softsign(utility) - 0.05 * err,
x + (PHI - 1) * 0.01 * (stability - x),
]
blended = [0.5 * raw + 0.5 * (old + (PHI - 1) * (now - old))
for raw, now, old in zip(family_outputs, cur, prev)]
gated = [now + gamma * (new - now) for now, new in zip(cur, blended)]
cpp_b = normalizer(family_outputs)
js_b = normalizer(gated)
cpp_next = [v * cpp_b for v in gated]
js_next = [v * js_b for v in gated]
maximum_difference = max(abs(a - b) for a, b in zip(cpp_next, js_next))
assert maximum_difference > 1e-6
return {
"controlled_parameters": {
"current_and_previous_components": 0.1, "weights": "all 1",
"dx_norm": dx, "ed_error": err, "utility": utility,
"stability": stability, "gamma_min": gamma_min, "phi_override": None,
},
"cpp_normalizer_before_blend_and_gate": cpp_b,
"js_normalizer_after_blend_and_gate": js_b,
"max_absolute_next_component_difference": maximum_difference,
"interpretation": "Different operation orders change outputs even with equal parameters.",
}
def main() -> None:
repeat_a = consciousness_output()
repeat_b = consciousness_output()
assert repeat_a == repeat_b
synchrony = sum(math.cos(2 * math.pi * i / 88) for i in range(88)) / 88
assert abs(synchrony) < 1e-14
result = {
"audit_date": "2026-09-15",
"execution_scope": "Independent Python formula reproductions only; NOT original repository test execution.",
"source_refs": {
"seferim-core": "1f05cd5640edf0a5fe93dc276a12a48db84fc702",
"seferim-agi-g16": "25f281b08b2f786f5a235b5abebfc39bf44d1044",
"gate_rebuild_plan": "Library Pasted text(1).txt: Gate5000 section, eq80-89 reference",
},
"gate5000": gate_first_tick(),
"neural_synchrony": {
"agent_count": 88, "value_from_fixed_km": synchrony,
"interpretation": "The inspected step() does not update km; this statistic stays fixed regardless of evolving x/y/P/c.",
},
"consciousness_engine": {
"value": repeat_a, "repeat_equal": repeat_a == repeat_b,
"interpretation": "Reinitializing the same input-free recurrence produces a constant, not a measurement of external runtime state.",
},
"meta_state_normalization_order": meta_state_order(),
}
print(json.dumps(result, indent=2, ensure_ascii=False))
if __name__ == "__main__":
main()