DXFS is a native character-and-digit storage format and editor written in C++20.
A .dx file stores supported ASCII character sequences in DXFS's own Packed
representation inside the compact DXF3 container. DXF1 files remain readable.
It is not intended to be a wrapper around an intermediate TXT, DOCX, PDF or archive file.
DXFS currently supports ASCII bytes (0..127), including digits, letters, spaces, punctuation, symbols and ASCII control characters.
- Digit-only streams retain the existing base-10 packed representation.
- Digit streams containing a decimal point retain the existing base-11 packed representation.
- General ASCII text compares continuous 7-bit, adaptive fixed-width alphabet, blockwise mixed-radix alphabet storage, and DXH adaptive canonical Huffman coding, and DXP context-predictive arithmetic coding.
- Alphabet representations store each distinct ASCII symbol once. Fixed-width indexes are fast; mixed-radix blocks reduce unused code space for selected alphabet sizes; DXH assigns shorter codes to frequent symbols, while DXP learns which symbols tend to follow each previous symbol.
- The encoder selects the smaller native representation; the decoder reconstructs the exact original bytes.
- The compact DXF3 header and CRC32 are included in every size measurement. DXF1 files remain readable.
The 7-bit representation stores eight ASCII characters in seven bytes when
the bitstream is full. Adaptive alphabet storage can use fewer bits per
character when the document contains a smaller character set. DXH can use fewer bits when symbol frequencies are uneven, at the cost of a per-file code table. DXP can exploit predictable local transitions without storing a model table. The compact DX header creates fixed overhead, so very small
inputs can be larger as .dx than as .txt. This is a representation
trade-off, not a claim that every possible input can be made smaller.
Older DX codec kinds remain readable for backward compatibility. DX Studio's current save path writes the native Packed representation only.
Format internals and byte layouts are documented in docs/FORMAT.md.
Requirements:
- CMake 3.20 or newer
- A C++20 compiler
- Windows: Visual Studio 2022 or another supported MSVC toolchain
- POSIX: a C++20 compiler for the terminal editor
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
ctest --test-dir build -C Release --output-on-failureThe build produces:
- Windows:
bin/dxtool.exeandbin/dxstudio.exe - POSIX:
bin/dxtoolandbin/dxedit
DX Studio uses the native Win32 UI and does not require Qt.
# Store ASCII text or a digit stream in native DX format
dxtool pack input.txt output.dx
# Reconstruct the exact stored text
dxtool unpack output.dx restored.txt
# Generate mathematical digit sequences
dxtool gen pi 100000 pi.dx
# Inspect a DX file
dxtool info pi.dxDX Studio retains its existing editing, undo/redo, search, navigation, streaming generation of mathematical constants, LCG generation and repeating pattern generation.
All DX Studio saves now use native Packed storage. Generated values are materialized and stored as actual data; saving no longer substitutes a generator descriptor for the generated characters.
The Benchmark button and Tools > Benchmark Character Storage command:
- Generate 100,000 random printable ASCII characters.
- Write
random_sample.txtandrandom_sample.dxunder%TEMP%\\DXFS_Benchmark. - Verify exact reconstruction by decoding the generated DX file.
- Compare complete TXT and DX file sizes, including the compact DXF3 header and checksum.
- Report uppercase/lowercase letters, digits, spaces and symbols.
- Report each generated character's frequency and its 7-bit payload cost for the random printable-ASCII sample.
- Run a six-alphabet efficiency sweep from two symbols through the full printable ASCII set, comparing selected Packed representations.
- Write a full report to
benchmark_report.txtand display it in a scrollable report window.
The benchmark is a randomized printable-ASCII test, not a universal claim about every file or Unicode text.
The current native text representation supports ASCII only. Bytes above 0x7F are rejected rather than silently changed. Unicode support requires a future format design that preserves the original encoded bytes exactly.
Existing RLE, Pattern, Constant, LCG, LZ and Blocked files remain supported by the reader where applicable. They are not selected by the current DX Studio save operation.
CTest includes packed digit round-trip, repeated-data round-trip, adaptive alphabet and DXH entropy round-trips, ASCII text round-trip, π generation, decimal-point round-trip, DXF1 compatibility, CRC validation and DXF2 block-store validation.
ctest --test-dir build -C Release --output-on-failure