khoa181101
Registered Member
Hi everyone,
I'd like to share an exploration into multi-base encoding and address calculus—specifically focusing on **UTF-34 Base-4**, its mathematical properties, benchmark throughput, and a generated dataset of the first 1,000,000 binary codes.
The full 137 MB dataset (1M codes) is available on GitHub via Git LFS:
- **Direct Data File:** [utf34_base4_1M_binary.md](https://github.com/anhkhoavanhua/utf34/blob/main/utf34_base4_1M_binary.md)
- **Raw LFS URL:** https://media.githubusercontent.com...tf34/refs/heads/main/utf34_base4_1M_binary.md
- **Repository & Specs:** [https://github.com/anhkhoavanhua/utf34](https://github.com/anhkhoavanhua/utf34)
---
### 1. Background: Codespace & The Zero-Waste Theorem
In standard Unicode, UTF-32 assigns a fixed 32-bit integer per scalar value across a code space limited to `0x10FFFF` (~1.1M code points). In the **UTF-N multi-base** framework (derived from Fold ⊘ and Carve ⊖ address calculus), we generalize code point mapping across arbitrary base systems $B$ with fixed width $N = 34$.
For **Base-4 ($B = 4, N = 34$)**:
- **Codespace capacity:** $4^{34} = 2^{68} = 295,147,905,179,352,825,856 \approx 2.95 \times 10^{20}$
- **Bit width per digit:** $w = \lceil \log_2 B \rceil = 2$ bits.
- **Total pure binary width:** $34 \times 2 = 68$ bits (packed into 9 bytes / 72 bits with 4-bit MSB padding).
#### The Waste Law: $\partial W = 0$
For non-power-of-two bases (e.g., base-3 where $B=3 \neq 2^k$), mapping digits into binary requires reserved/sentinel states (pattern `11` is invalid), introducing an address waste $\partial W > 0$ unless packed via variable-base techniques (like MIN-WASTE 5-trit/byte).
In contrast, because $4 = 2^2$ is an exact power of 2:
$$\partial W = 0 \iff B = 2^k \iff \delta = 0$$
Every 2-bit combination (`00`, `01`, `10`, `11`) is strictly valid. There are **zero reserved patterns** and **zero bit-waste**, forming a compact bijective map from $\mathbb{Z}_{4^{34}} \longleftrightarrow \{0, 1\}^{68}$.
---
### 2. Structure of the 1,000,000 Codes Dataset
The published dataset covers decimal values $0 \dots 999,999$:
* `dec`: Decimal value ($0 \dots 999,999$).
* `quad34`: 34 base-4 digits ($0, 1, 2, 3$; MSB-first), where $\text{val} = \sum_{i=0}^{33} d_i \cdot 4^i$.
* `bin68`: Pure 68-bit binary representation ($2\text{ bits}/\text{digit}$).
* `hex9`: 9-byte hex representation (72-bit big-endian).
Sample preview from the file:
```text
dec | quad34 (base-4) | bin68 (2-bit/digit) | hex9
--------+------------------------------------+----------------------------------------------------------------------+-------------------
0 | 0000000000000000000000000000000000 | 00000000000000000000000000000000000000000000000000000000000000000000 | 000000000000000000
1 | 0000000000000000000000000000000001 | 00000000000000000000000000000000000000000000000000000000000000000001 | 000000000000000001
2 | 0000000000000000000000000000000002 | 00000000000000000000000000000000000000000000000000000000000000000010 | 000000000000000002
3 | 0000000000000000000000000000000003 | 00000000000000000000000000000000000000000000000000000000000000000011 | 000000000000000003
4 | 0000000000000000000000000000000010 | 00000000000000000000000000000000000000000000000000000000000000000100 | 000000000000000004
8 | 0000000000000000000000000000000020 | 00000000000000000000000000000000000000000000000000000000000000001000 | 000000000000000008
16 | 0000000000000000000000000000000100 | 00000000000000000000000000000000000000000000000000000000000000010000 | 000000000000000010
I'd like to share an exploration into multi-base encoding and address calculus—specifically focusing on **UTF-34 Base-4**, its mathematical properties, benchmark throughput, and a generated dataset of the first 1,000,000 binary codes.
The full 137 MB dataset (1M codes) is available on GitHub via Git LFS:
- **Direct Data File:** [utf34_base4_1M_binary.md](https://github.com/anhkhoavanhua/utf34/blob/main/utf34_base4_1M_binary.md)
- **Raw LFS URL:** https://media.githubusercontent.com...tf34/refs/heads/main/utf34_base4_1M_binary.md
- **Repository & Specs:** [https://github.com/anhkhoavanhua/utf34](https://github.com/anhkhoavanhua/utf34)
---
### 1. Background: Codespace & The Zero-Waste Theorem
In standard Unicode, UTF-32 assigns a fixed 32-bit integer per scalar value across a code space limited to `0x10FFFF` (~1.1M code points). In the **UTF-N multi-base** framework (derived from Fold ⊘ and Carve ⊖ address calculus), we generalize code point mapping across arbitrary base systems $B$ with fixed width $N = 34$.
For **Base-4 ($B = 4, N = 34$)**:
- **Codespace capacity:** $4^{34} = 2^{68} = 295,147,905,179,352,825,856 \approx 2.95 \times 10^{20}$
- **Bit width per digit:** $w = \lceil \log_2 B \rceil = 2$ bits.
- **Total pure binary width:** $34 \times 2 = 68$ bits (packed into 9 bytes / 72 bits with 4-bit MSB padding).
#### The Waste Law: $\partial W = 0$
For non-power-of-two bases (e.g., base-3 where $B=3 \neq 2^k$), mapping digits into binary requires reserved/sentinel states (pattern `11` is invalid), introducing an address waste $\partial W > 0$ unless packed via variable-base techniques (like MIN-WASTE 5-trit/byte).
In contrast, because $4 = 2^2$ is an exact power of 2:
$$\partial W = 0 \iff B = 2^k \iff \delta = 0$$
Every 2-bit combination (`00`, `01`, `10`, `11`) is strictly valid. There are **zero reserved patterns** and **zero bit-waste**, forming a compact bijective map from $\mathbb{Z}_{4^{34}} \longleftrightarrow \{0, 1\}^{68}$.
---
### 2. Structure of the 1,000,000 Codes Dataset
The published dataset covers decimal values $0 \dots 999,999$:
* `dec`: Decimal value ($0 \dots 999,999$).
* `quad34`: 34 base-4 digits ($0, 1, 2, 3$; MSB-first), where $\text{val} = \sum_{i=0}^{33} d_i \cdot 4^i$.
* `bin68`: Pure 68-bit binary representation ($2\text{ bits}/\text{digit}$).
* `hex9`: 9-byte hex representation (72-bit big-endian).
Sample preview from the file:
```text
dec | quad34 (base-4) | bin68 (2-bit/digit) | hex9
--------+------------------------------------+----------------------------------------------------------------------+-------------------
0 | 0000000000000000000000000000000000 | 00000000000000000000000000000000000000000000000000000000000000000000 | 000000000000000000
1 | 0000000000000000000000000000000001 | 00000000000000000000000000000000000000000000000000000000000000000001 | 000000000000000001
2 | 0000000000000000000000000000000002 | 00000000000000000000000000000000000000000000000000000000000000000010 | 000000000000000002
3 | 0000000000000000000000000000000003 | 00000000000000000000000000000000000000000000000000000000000000000011 | 000000000000000003
4 | 0000000000000000000000000000000010 | 00000000000000000000000000000000000000000000000000000000000000000100 | 000000000000000004
8 | 0000000000000000000000000000000020 | 00000000000000000000000000000000000000000000000000000000000000001000 | 000000000000000008
16 | 0000000000000000000000000000000100 | 00000000000000000000000000000000000000000000000000000000000000010000 | 000000000000000010