# RRLS v0.26 — Exactness Firewall & Semantic-Future Audit

## Status

**P = NP is not proved.**

v0.26 deliberately attacks RRLS itself rather than the complexity wall.  The audit
separates mathematical exactness from numerical approximation, serialization hazards,
sensor quantization, cryptographic identifiers, and incomplete notions of "same future."

The audit found one real reporting bug class, several proof-grade hygiene issues, and a
major over-count in the v0.25 notion of future complexity.

---

## 1. Exactness taxonomy

| module                              | quantity                                                          | class                   | representation                                           | risk                                                                                 |
|:------------------------------------|:------------------------------------------------------------------|:------------------------|:---------------------------------------------------------|:-------------------------------------------------------------------------------------|
| rrls_collision_algebra.py           | SAT/#SAT states, coefficients, counts                             | EXACT                   | Python arbitrary-precision int + tuple/dict equality     | No numeric rounding; worst-case state explosion remains.                             |
| rrls_cycle_relational_tomography.py | raw projections, histograms, collision counts, resonance graph    | EXACT (patched v0.26)   | int64 projections + integer counts + exact byte identity | Explicit truth-table enumeration remains exponential.                                |
| rrls_cycle_relational_tomography.py | Kuramoto synchronization order parameter                          | APPROXIMATE             | IEEE-754 float64                                         | Not proof-grade; now retained unrounded but still floating.                          |
| rrls_universal_cycle.py             | synthetic waveform, least-squares recovery, phase/depth estimates | APPROXIMATE             | IEEE-754 float64                                         | Depth uses intentional nearest-integer classification; dynamics are a toy model.     |
| rrls_collision_dance.py             | physical-toy collision/speed/synchronization measurements         | QUANTIZED + APPROXIMATE | float64 positions + finite cell/speed bins               | Counts depend on sensor resolution; not literal exact geometric collisions.          |
| benchmark regression fits           | empirical exponential/polynomial fit parameters                   | APPROXIMATE             | float64 regression                                       | Finite-sample descriptive fit only; not an asymptotic proof.                         |
| CSV benchmark exports               | large exact integers                                              | NONCANONICAL            | text interpreted by downstream software                  | pandas/Excel may promote integer+missing columns to float and lose units above 2^53. |
| rrls_exact_io.py                    | canonical exact artifacts                                         | EXACT                   | tagged decimal integers/rationals in JSON                | Use this rather than generic numeric JSON/CSV for proof artifacts.                   |

The rule going forward is:

> A proof claim may depend only on quantities marked EXACT.  Approximate or quantized
> quantities may generate hypotheses and diagnostics, but never certify equivalence,
> SAT/UNSAT, or asymptotic complexity.

---

## 2. Core SAT/#SAT arithmetic is integer exact

Static audit of `rrls_collision_algebra.py` found:

- zero NumPy arithmetic in the exact core;
- no floating-point values in logical state, coefficients, model counts, masks, or
  canonical residual identities;
- Python arbitrary-precision integers throughout;
- float fields only for elapsed-time/compression-ratio diagnostics.

Independent oracle test:

    64/64 formulas exact

against both an independently written Boolean enumerator and SymPy's Boolean model
enumeration, while five RRLS exact engines returned the same counts.

The prior v0.25 differential suite remains 1,064/1,064 exact method/formula checks.

---

## 3. 301-digit #SAT test

Formula:

    F = (x1)

with n=1000 variables.

Exact answer:

    #SAT = 2^999

which has 301 decimal digits.

All five exact engines returned that same arbitrary-precision integer.

|    n |   expected_bit_length |   decimal_digits | all_exact   |
|-----:|----------------------:|-----------------:|:------------|
|   64 |                    64 |               19 | True        |
|  100 |                   100 |               30 | True        |
|  256 |                   256 |               77 | True        |
| 1000 |                  1000 |              301 | True        |

Thus the SAT core is not silently limited to 32-bit, 64-bit, IEEE-754, or JavaScript
integer precision.

---

## 4. Real bug found: pandas float promotion can corrupt exported counts

A benchmark table containing

    count = 2^60 + 1

and a missing value was automatically promoted by pandas to `float64`.

Original:

    1152921504606846977

CSV:

    1.152921504606847e+18

Reading it back as a float and converting to integer gives:

    1152921504606846976

**one exact unit was lost.**

This explains why `benchmark_v25_mode_ladder.csv` wrote exact small counts as `0.0`
and `64.0`: the `UNKNOWN` rows forced a float column.

Those particular v0.25 values were below 2^53 and therefore numerically unchanged, but
the export pattern was unsafe.

v0.26 adds `rrls_exact_io.py` and makes tagged JSON the canonical proof artifact:

    {"$int":"1152921504606846977"}

Rationals are likewise serialized as exact numerator/denominator pairs.

CSV remains a human convenience format, not the canonical exact representation.

---

## 5. Cryptographic hashes removed from proof identity

v0.24 ambiguity reports used SHA-256 truth hashes as relation identities.

SHA-256 is overwhelmingly collision-resistant, but it is not a mathematical
collision-free identity.

The 72-relation corpus was regenerated from the original seeds and compared using the
actual truth-table bytes.

Results:

    exact byte identities = 72
    SHA identities        = 72

The tomography benchmark was recomputed with exact byte identity and integer collision
moments:

| signature                       |   distinct_truths |   signature_classes |   ambiguous_truths |   resolved_fraction |   max_truths_per_signature |
|:--------------------------------|------------------:|--------------------:|-------------------:|--------------------:|---------------------------:|
| static k+|D|                    |                72 |                  46 |                 42 |            0.416667 |                          6 |
| 1 exact full histogram probes   |                72 |                  66 |                 11 |            0.847222 |                          3 |
| 4 exact full histogram probes   |                72 |                  70 |                  4 |            0.944444 |                          2 |
| 8 exact full histogram probes   |                72 |                  71 |                  2 |            0.972222 |                          2 |
| 16 exact full histogram probes  |                72 |                  71 |                  2 |            0.972222 |                          2 |
| 32 exact full histogram probes  |                72 |                  72 |                  0 |            1        |                          1 |
| 4 raw-int collision probes      |                72 |                  67 |                  9 |            0.875    |                          3 |
| 8 raw-int collision probes      |                72 |                  67 |                  9 |            0.875    |                          3 |
| 16 raw-int collision probes     |                72 |                  67 |                  9 |            0.875    |                          3 |
| 32 raw-int collision probes     |                72 |                  67 |                  9 |            0.875    |                          3 |
| 4 exact resonance graph probes  |                72 |                  69 |                  5 |            0.930556 |                          3 |
| 8 exact resonance graph probes  |                72 |                  69 |                  5 |            0.930556 |                          3 |
| 16 exact resonance graph probes |                72 |                  69 |                  5 |            0.930556 |                          3 |
| 32 exact resonance graph probes |                72 |                  72 |                  0 |            1        |                          1 |

The main finite headline survives exactly:

    32 full fixed histograms -> 72/72 distinguished
    32 exact resonance graphs -> 72/72 distinguished

So the old result was not caused by a hash collision or normalized float rounding.

---

## 6. Normalized float signatures can genuinely alias

Two distinct rationals

    2^60 / 2^61

and

    (2^60 + 1) / 2^61

are mathematically different by

    1 / 2^61,

yet both convert to the exact same IEEE-754 double:

    0.5.

Therefore normalized collision moments represented only as floats cannot be used as
proof identities.

v0.26 adds exact `(numerator, denominator)` collision signatures.

---

## 7. v0.24 physical toy simulation is intentionally approximate

`rrls_universal_cycle.py` uses float64 sinusoids, exponentials, least squares,
logarithms and phase angles.

Depth recovery explicitly computes a continuous estimate and then applies nearest-
integer classification:

    d_hat = round(-log(gain)/alpha).

That rounding is intentional because the toy model defines depth as a discrete class.
The unrounded `depth_float` is retained.

Numerical conditioning audit of the two universal excitation channels:

    Gram condition number ≈ 1.0000000000000007
    channel correlation  ≈ -3.26e-16

At noise 0.1 the smallest observed best-vs-second anchor score gap was about
7.56e-7 relative to the best score, versus machine epsilon ≈2.22e-16.

|   noise |   anchor_exact_rate |   min_abs_score_gap |   median_abs_score_gap |   min_relative_gap |   median_relative_gap |   count_relative_gap_lt_1e-12 |   count_relative_gap_lt_1e-10 |   machine_epsilon |
|--------:|--------------------:|--------------------:|-----------------------:|-------------------:|----------------------:|------------------------------:|------------------------------:|------------------:|
|     0   |            1        |         0.0265653   |               0.277966 |        0.00170407  |            0.00450224 |                             0 |                             0 |       2.22045e-16 |
|     0.1 |            0.942857 |         3.58235e-05 |               0.181693 |        7.55976e-07 |            0.00284892 |                             0 |                             0 |       2.22045e-16 |
|     0.5 |            0.41     |         0.000469708 |               0.108286 |        7.66953e-06 |            0.00178514 |                             0 |                             0 |       2.22045e-16 |
|     1   |            0.224286 |         0.000219951 |               0.118357 |        1.42697e-06 |            0.0019317  |                             0 |                             0 |       2.22045e-16 |

Thus the reported anchor-recovery failures in that test are dominated by model/noise
ambiguity, not floating-point tie-breaking.

This does not make the physical toy simulation exact; it only shows numerical
roundoff is far below the measured decision margins in this audit.

---

## 8. v0.24 collision dance is quantized, not literal geometry

Physical-toy "collisions" are defined by

    qx = round(x / cell_size)
    qy = round(y / cell_size)
    qv = round(speed / speed_bin).

Therefore they are **finite-resolution sensor collisions**, not exact point
intersections.

The published v0.24 robustness sweep intentionally varied sensor cell size and showed
that absolute collision counts depend strongly on resolution while the qualitative
force/collision trend survived.

A new micro-perturbation audit around `cell_size=0.10` and `speed_bin=1.25` found no
changes for ±1e-9 perturbations on one tested population, so the particular run was not
sitting on numerical bin boundaries.  This is a stability check, not a proof of
resolution independence.

---

## 9. Input-contract bugs closed

v0.25 assumed well-formed CNF coordinates.

v0.26 now rejects:

- literal 0;
- negative variable-count `n`;
- `n` smaller than the maximum variable identifier.

| case         | rejected   | exception                                                   |
|:-------------|:-----------|:------------------------------------------------------------|
| literal_zero | True       | ValueError: CNF literal 0 is invalid; variables are 1-based |
| n_too_small  | True       | ValueError: n=2 is smaller than maximum variable id 3       |
| negative_n   | True       | ValueError: n must be nonnegative                           |

Malformed coordinate systems can no longer silently enter an exact run.

---

## 10. Order and normalization invariance

36 adversarial small formulas were augmented with duplicate clauses and tautologies.

For each formula, 14 exact execution variants were tested across collision orders,
projected collision, sparse frontier and residual synchronization.

Result:

    36 / 36 formulas
    × 14 method/order variants
    = 504 exact answers.

The special-case suite also verified variable gaps, disconnected components, hundreds
of free variables, empty CNF, empty clause, and tautology-only formulas.

| case           |   n |   decimal_digits | all_exact   |
|:---------------|----:|-----------------:|:------------|
| gapped         | 100 |               30 | True        |
| disconnected   |  30 |                9 | True        |
| free_vars      | 500 |              151 | True        |
| empty_cnf      | 200 |               61 | True        |
| empty_clause   | 200 |                1 | True        |
| tautology_only | 200 |               61 | True        |

---

## 11. Major conceptual correction: v0.25 future modes were syntactic

v0.25 merged two histories when their canonical residual CNF syntax was identical.

That is sufficient for exact synchronization, but not necessary.

For example:

    (x OR y) AND (NOT x OR y)

and

    (y)

are semantically the same future but syntactically different.

Therefore the reported residual-state width was an upper bound on true semantic future
width.

Exact clause-subsumption normalization was added.  On fresh phase-transition samples:

|   n |   cases |   median_old_peak |   median_subsumed_peak |   median_peak_ratio |   median_old_seconds |   median_subsumed_seconds |
|----:|--------:|------------------:|-----------------------:|--------------------:|---------------------:|--------------------------:|
|  20 |       3 |                91 |                     84 |            0.923077 |           0.00920048 |                 0.0144459 |
|  30 |       3 |              2671 |                   2398 |            0.897791 |           0.40116    |                 0.511231  |
|  40 |       3 |             13654 |                  10226 |            0.748938 |           3.40523    |                 3.64084   |

At n=40, median residual peak fell from 13,654 to 10,226 (about 25% reduction) while
preserving exact counts.

---

## 12. Exact semantic-future audit

For three v0.25 peak snapshots, all residual functions were compared by their complete
Boolean truth functions using Python arbitrary-precision bitsets.

|   n |   tick |   frontier_bits |   live_frontier_states |   future_variables |   syntactic_future_classes |   semantic_future_classes |   syntax_to_semantic_ratio |   frontier_to_semantic_ratio |   largest_syntax_group_same_semantics |   elapsed_seconds |
|----:|-------:|----------------:|-----------------------:|-------------------:|---------------------------:|--------------------------:|---------------------------:|-----------------------------:|--------------------------------------:|------------------:|
|  20 |     47 |              16 |                   1044 |                  2 |                         20 |                         8 |                        2.5 |                        130.5 |                                     9 |        4.3634e-05 |
|  30 |     32 |              17 |                   1438 |                 13 |                        546 |                         1 |                      546   |                       1438   |                                   546 |        0.01305    |
|  40 |     51 |              25 |                  26404 |                 14 |                      10302 |                         2 |                     5151   |                      13202   |                                 10299 |        0.0607798  |

The n=40 snapshot is striking:

    26,404 live frontier assignments
      -> 10,302 syntactic residual CNFs
      -> 2 exact Boolean future functions.

Validation:

|   n | formula_status   |   formula_count |   snapshot_tick |   future_vars |   syntactic_classes |   semantic_classes | semantic_class_sizes_and_modelcounts                             | all_residuals_unsat   |   solve_seconds |
|----:|:-----------------|----------------:|----------------:|--------------:|--------------------:|-------------------:|:-----------------------------------------------------------------|:----------------------|----------------:|
|  20 | SAT              |             222 |              47 |             2 |                  20 |                  8 | [(9, 1), (4, 2), (2, 2), (1, 4), (1, 3), (1, 2), (1, 1), (1, 0)] | False                 |       0.0129693 |
|  30 | UNSAT            |               0 |              32 |            13 |                 546 |                  1 | [(546, 0)]                                                       | True                  |       0.0241269 |
|  40 | SAT              |               3 |              51 |            14 |               10302 |                  2 | [(10299, 0), (3, 1)]                                             | False                 |       0.166114  |

At n=40:

    10,299 syntactic residuals = UNSAT future
    3 syntactic residuals      = the same one-model future.

At n=30, all 546 syntactic residuals were different descriptions of the empty
(UNSAT) future.

This exact semantic comparison enumerated all assignments of the remaining 13-14
variables, so **it is an exponential oracle and not a polynomial algorithm**.

The result proves that v0.25's syntactic future count can dramatically overestimate
semantic diversity on these finite snapshots; it does not solve the canonicalization
problem.

---

## 13. Can known polynomial algebras recognize those semantic classes?

First, algebra-only routing:

|   n |   syntactic_residuals |   recognized_by_poly_router |   recognized_fraction |   poly_UNSAT |   poly_SAT |   unknown | router_breakdown                                                                                     |     seconds |
|----:|----------------------:|----------------------------:|----------------------:|-------------:|-----------:|----------:|:-----------------------------------------------------------------------------------------------------|------------:|
|  20 |                    20 |                          20 |              1        |            1 |         19 |         0 | {('UNSAT', '2-SAT/SCC'): 1, ('SAT', '1-valid'): 16, ('SAT', '0-valid'): 2, ('SAT', '2-SAT/SCC'): 1}  | 0.000288325 |
|  30 |                   546 |                         235 |              0.430403 |          235 |          0 |       311 | {('UNSAT', 'GF(2)/rank'): 234, ('UNKNOWN', 'uncompiled residual'): 311, ('UNSAT', '2-SAT/SCC'): 1}   | 0.0318594   |
|  40 |                 10302 |                        1271 |              0.123374 |         1271 |          0 |      9031 | {('UNSAT', '2-SAT/SCC'): 1, ('UNKNOWN', 'uncompiled residual'): 9031, ('UNSAT', 'GF(2)/rank'): 1270} | 0.807706    |

Then a fixed hybrid router using known algebraic dispatch plus exact bucket elimination
only when min-fill width <= 8:

|   n |   residuals |   recognized |   recognized_fraction |   UNSAT |   SAT |   UNKNOWN | breakdown                                                                                                                                                                                                                 |   seconds |
|----:|------------:|-------------:|----------------------:|--------:|------:|----------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------:|
|  30 |         546 |          546 |                     1 |     546 |     0 |         0 | {('UNSAT', 'algebraic', 'GF(2)/rank'): 234, ('UNSAT', 'structural', 'low-width exact bucket elimination'): 311, ('UNSAT', 'algebraic', '2-SAT/SCC'): 1}                                                                   |   0.25298 |
|  40 |       10302 |        10302 |                     1 |   10299 |     3 |         0 | {('UNSAT', 'algebraic', '2-SAT/SCC'): 1, ('UNSAT', 'structural', 'low-width exact bucket elimination'): 9028, ('UNSAT', 'algebraic', 'GF(2)/rank'): 1270, ('SAT', 'structural', 'low-width exact bucket elimination'): 3} |   7.24883 |

For the tested snapshots:

### n=30
All 546 residuals were polynomially certified UNSAT:

    234 -> GF(2) rank
    311 -> width<=8 structural elimination
    1   -> 2-SAT/SCC

### n=40
All 10,302 residuals were polynomially classified:

    1     -> UNSAT 2-SAT
    1,270 -> UNSAT GF(2)
    9,028 -> UNSAT width<=8
    3     -> SAT width<=8

This is a strong finite observation.

But reaching that snapshot had already required representing many histories.  A general
P=NP proof would have to show that a polynomially bounded path always reaches such a
tractable future decomposition before state population explodes.

No such theorem is proved here.

---

## 14. What is exact now?

Proof-safe quantities:

    Boolean truth values
    CNF normalization
    partial assignments
    collision merges
    integer coefficients
    #SAT counts
    model-count multiplicities
    exact residual CNF identity
    subsumption
    raw integer tomography histograms
    raw collision moments
    exact resonance graph connectivity
    exact truth-table byte identity
    tagged arbitrary-precision integer/rational serialization

Not proof-safe by themselves:

    float64 trajectories
    Kuramoto order parameters
    least-squares parameter estimates
    rounded depth categories
    finite sensor cells
    empirical scaling regressions
    wall-clock timing
    SHA hashes as mathematical identity
    ordinary CSV numeric type inference

---

## 15. Strongest new research target

The audit moves the question again.

The apparent number of futures can be enormous while the exact semantic future set is
tiny.  Therefore the target should not be merely:

    compress residual syntax.

It should be:

    compute a canonical semantic certificate of the future
    without evaluating its full truth table.

Known polynomial examples already do this:

    affine residual     -> rank
    2-SAT residual      -> SCC
    bounded-width core  -> exact separator DP
    matching structure  -> augmenting-path/Hall certificate.

The missing theorem is a polynomial semantic canonicalizer that covers every residual
before the mode population becomes superpolynomial.

That remains open.
