Skip to content

Branch main Algo state normalization

github-actions[bot] edited this page May 31, 2026 · 102 revisions

Algorithm: State Normalization

Back to Branch Overview

Field Value
Branch main
Source specs/algorithms/state_normalization.pseudo.md
Commit a8bea152e7f9
Synced (UTC) 2026-05-31T05:49:29Z

Visual Context

Algorithm pages define deterministic platform-neutral behavior that downstream repos implement behind native adapters.

flowchart LR
  Input["Input contract"] --> Preconditions["Preconditions"]
  Preconditions --> Decision["Deterministic decision"]
  Decision --> Output["Output contract"]
  Decision --> Diagnostic["Diagnostic envelope"]
  Diagnostic --> Audit["Audit chain"]
Loading

Reading Checklist

Question Where to look
What is deterministic? Read the pseudocode branch table and preconditions.
What blocks unsafe behavior? Look for blocked, ambiguous, policy, or precondition paths.
How is the decision reconstructable? Trace diagnostic and audit requirements.

Source Content

State Normalization

Normalization is deterministic on the full 9-bit ASH state.

FUNCTION normalize_state(candidate_state, canonical_codeword_set) -> NormalizationResult
  REQUIRE candidate_state has exactly 9 binary coordinates
  diagnostic = diagnose_state_validity(candidate_state)
  IF diagnostic.admissibilityStatus == VALID:
    RETURN {status: ALREADY_VALID, normalizedState: candidate_state, diagnostic}
  IF diagnostic.admissibilityStatus == TRANSFORMATION_COMPATIBLE:
    path = deterministic_lowest_lexicographic_codeword_path(candidate_state, canonical_codeword_set)
    IF path exists:
      RETURN {status: NORMALIZED, normalizedState: apply(path), diagnostic}
  RETURN {status: BLOCKED, diagnostic}
END FUNCTION

Clone this wiki locally