K — Dendritic Structural Encoding (KDSE)

Technical specification · language-independent structural definition

Specification for the KDSE structural core

K — Dendritic Structural Encoding (KDSE) is UHWare's compact, delimiterless breadth-first encoding of finite full q-ary dendritic structures.

KDSE records the branch-or-terminal decisions of a finite rooted dendrite in a binary payload. A branch creates exactly q child positions; a terminal creates none. The payload is structural: KDSE defines the encoded object, while a separate operator may use that object to perform a computation.

Core boundary KDSE defines the structure. An operator defines a particular computation over that structure. The threshold-and-loss response and instantaneous jump magnitude are worked operators, not requirements for payload validity.

1. Structural object and notation

Let q ≥ 2 be the structural arity. Every branch node has exactly q ordered children, and every other node is terminal. The root is at depth zero. Each explicit node carries one binary branch indicator:

SymbolMeaning
1The node is a branch and creates exactly q child positions.
0The node is a terminal and creates no child positions.
qThe branching arity; it is independent of the binary structural alphabet.

The binary alphabet distinguishes branch from terminal even when q is greater than two. The physical storage radix and container width are separate engineering choices. The mathematical family is therefore independent of whether a payload is packed into binary, a byte, a word, or another storage format.

2. Minimal breadth-first encoding

Explicit node indicators are concatenated level by level in breadth-first order. Let wℓ be the number of explicit positions at level ℓ, and let bℓ be the number of branch indicators in that level. The first level contains the root:

w0 = 1     and     wℓ+1 = qbℓ

Once a level has been read, its branch count determines the exact width of the next level. Internal level boundaries therefore require no delimiter. This is the precise sense in which KDSE is delimiterless.

The deepest level of a finite full tree contains only terminals. KDSE minimal form omits that deterministic final all-terminal level. Branches in the last encoded level therefore have q implicit terminal children. The isolated terminal root is the single-symbol payload 0.

PayloadDerived levelsReconstructed meaning
00Isolated terminal root.
11Root branch with q implicit terminal children.
1011 | 01One terminal at depth 1; the other explicit child branches, with its final children implicit.
101011 | 01 | 01Terminals at depths 1, 2, and 3 in the binary case.

The vertical bars above are explanatory only. They are reconstructed from branch counts and are not stored in the payload.

2.1 Minimal-form length

Every level after the root has width divisible by q. Consequently, every minimal-form payload length satisfies:

L ≡ 1 (mod q)

Binary minimal-form lengths are therefore odd. For a binary payload budget of seven symbols, the possible lengths are 1, 3, 5, and 7.

2.2 Boundary of a value

Minimal form removes internal structural delimiters; it does not provide framing for a stream of multiple variable-length values. A concatenated stream still needs an outer container, length field, framing convention, or an untrimmed fixed-width representation.

3. Decoding and validity

A decoder begins with expected width w0 = 1. At each level it reads exactly the expected number of symbols, counts the branches, and computes the next width from the recurrence above. A binary minimal-form payload is valid when:

  1. Every symbol is 0 or 1.
  2. Each complete derived level is present.
  3. The payload ends exactly on a level boundary.
  4. No data follows a level with zero branches.
  5. Except for the isolated payload 0, the final encoded level contains at least one branch; an explicit final all-terminal level is superfluous and invalid in minimal form.

If the final encoded level contains bD branches, the reconstructed tree contains L + qbD nodes: the explicit payload nodes plus the implicit terminal children of those final branches.

4. Ordered canonical form

A minimal-form payload preserves child position. When sibling position is not an independent semantic attribute, exchanging sibling subtrees can produce multiple payloads for the same unordered rooted topology. Ordered KDSE selects one canonical representative: the valid serialization with the lowest numerical value.

Ordered form is a canonical subtype, not a restriction on structural validity. A valid structural KDSE may represent any finite full topology, including an unbalanced, lopsided, or deep topology. Canonicalization removes sibling-permutation synonyms where the application treats those permutations as equivalent.

5. Container formats: KDSE-8 and KDSE-16

KDSE-8 and KDSE-16 name current binary physical container classes. They are not limits on the underlying KDSE mathematical construction and they do not describe branching arity.

ContainerStructural arityPayload budgetPhysical widthMeaning
KDSE-8q = 27 symbols8 bitsOne container bit is outside the core payload field.
KDSE-16q = 215 symbols16 bitsThe same container convention at twice the physical width.

Within a fixed-width container, leading padding is not parsed as part of the minimal payload. The actual payload length is recovered from the natural-width value after container padding is removed. The reserved or padding bits belong to the container format; KDSE assigns them no intrinsic structural meaning.

6. Values and structural attributes

Values may accompany a KDSE structure, but they are independent of the branch/terminal payload. When values are supplied, they are listed in the same breadth-first order as the reconstructed nodes, including the implicit final leaves.

The structure determines intrinsic attributes such as level widths, branch counts, terminal-depth profiles, leaf path words, subtree sizes, balance measures, symmetry counts, and canonical forms. Different Ordered values can share the same terminal-depth profile; a projection that uses only that profile intentionally discards other topology information.

7. Operators and the IJM example

A KDSE value can be supplied to any operator that accepts its structure or a structural projection. In general, an operator combines K with an input and parameters:

y = Φ(K, x; θ)

The threshold-and-loss operator is one worked example. Under equal q-way splitting, uniform multiplicative retention, and a common terminal threshold T, all terminals at an occupied depth d activate together. If cd is the number of reconstructed terminals at that depth, the grouped instantaneous jump magnitude is:

Jd = T · cd

Branch transfer and depth determine where an event occurs; terminal multiplicity and the threshold determine the grouped jump magnitude. This identity is a result of that operator and its assumptions, not a condition for a KDSE payload to be valid.

8. Conformance summary

An implementation claiming conformance to the structural core should agree on:

The current public reference release provides ISO C11 and Python implementations of the KDSE-8 and KDSE-16 container forms. The structural definition above is language-independent.

Document: Technical specification for K — Dendritic Structural Encoding.

Author: Mark Karaman · UHWare

Documentation license: CC BY-SA 4.0

Related papers: Introductory Paper (HTML) · Introductory Paper (PDF) · Instantaneous Jump Magnitude Paper (HTML) · Instantaneous Jump Magnitude Paper (PDF)

Patent status: U.S. Patent Pending — Application No. 64/131,240