Skip to content

research: stage frozen ARX6 codec, conformance tests, and production-baseline harness - #117

Draft
baanish wants to merge 1 commit into
mainfrom
research/arx6-native-frame
Draft

research: stage frozen ARX6 codec, conformance tests, and production-baseline harness#117
baanish wants to merge 1 commit into
mainfrom
research/arx6-native-frame

Conversation

@baanish

@baanish baanish commented Sep 5, 2026

Copy link
Copy Markdown
Owner

Scope

Import the executable general ARX6 research prototype as a draft, with reproducible conformance checks and a benchmark entry point against the complete production auto-selector.

This is not viewer integration. No codec registry, default auto-selection, UI, historical decoder, shipped dictionary, dependency, or deployment configuration changes. The experimental #g1L... wire is not supported by the current viewer and must not be distributed as a working share link.

The second-pass numeric reconstruction-program / dependency-order experiments are intentionally excluded. Their specialist wins did not justify adding them to the general codec.

Included

  • The frozen, browser-safe native-frame codec under experiments/arx6/src/: raw WTF-8 tuples; causal lexical/character-class contexts; residual syntax mixer; earlier match discovery; base64url framing; CRC32; immutable SHA-256-pinned copies of the existing three 16 KiB priors. The evaluated core files are copied unchanged.
  • experiments/arx6/check.mjs: 16 dependency-free checks using the repository's existing assets. The same cases are registered in tests/arx6-core.test.ts for Vitest.
  • experiments/arx6/bench.mts: a new corpus-driven comparison with the entire production encodeEnvelopeAsync auto pool, the real Markdown formatter, round-trip assertions, complete link lengths, and exact legacy fallback. It emits measurements/hashes rather than unsupported viewer links.
  • Qualified historical results, source freeze record, reproduction instructions, and an explicit integration/deployment checklist in docs/arx6-research.md.

The Node-only runtime contains a laboratory copy of the ARX2 tuple mapping. Production integration should expose/reuse the canonical helpers rather than preserve this duplication.

What the earlier research actually established

Across 93 held-out software-text proxies from 47 disjoint source groups: 7.41% aggregate full-link savings with fallback; 7.36% standalone; 90/93 strict wins; 3 standalone regressions; worst regression 2.77%. Entire artifacts fitting 2,000 characters went from 75 to 76.

That historical baseline was the shorter of exact ARX5 entropy/base64url and ARX2 with Node Brotli q11, not the full production portfolio and not a byte-identical brotli-wasm validation. Do not describe those numbers as results from the newly added production-baseline runner.

The existing report fixture was a separate diagnostic, not held-out evidence: the whole link shrank 2,616 → 2,301 characters and still did not fit. Exhaustive complete-line prefixes increased fitting source text 5,867 → 7,158 characters at the same 1,996-character link length. The 22% capacity gain is fixture-specific.

Verification

Executed in the authoring environment:

  • Original prototype suite: 20/20 groups passed, including legacy golden vectors and 80 seeded random round trips.
  • New node experiments/arx6/check.mjs: 16/16 checks passed, including source hashes, every UTF-16 code unit, lone surrogates, exact whitespace/control preservation, prior identity/ownership, metadata, corruption/truncation, hostile lengths, and fallback.

Not executed there:

  • Repository Vitest wrapper, lint, complete typecheck/build, and existing app suite.
  • New full-production-baseline benchmark.
  • Application/Worker integration and browser/live-chat transport checks.

The environment could run Node against the attached prototype but could not clone the repository or obtain its npm dependencies. The draft status is deliberate; local core checks are not being presented as full application CI.

Before production integration / enablement

  • Reuse canonical tuple helpers; validate reconstructed envelopes through the normal schema/normalization path; reconcile fragment and decoded budgets. The frozen core's 8,192-character limit includes #, unlike the app's body-only budget.
  • Implement explicitly versioned async encode/decode routing and opt-in emission; leave existing wire versions untouched.
  • Add bounded Worker execution/cancellation and measure worst-case latency/peak memory. Async installation is not non-blocking compression.
  • Preserve the complete old auto result byte-for-byte on ties/losses/unavailability and evaluate independent real-agent data.
  • Complete Chromium/WebKit, asset loading/skew, UI, and actual Discord/WhatsApp paste/click tests; update protocol docs, examples, pickers, and agent skill together.

Reproduce

node experiments/arx6/check.mjs
npx vitest run tests/arx6-core.test.ts
node --import tsx experiments/arx6/bench.mts corpus.json > arx6-comparison.json

The corpus format is a JSON array of { "id": "...", "envelope": ... } samples satisfying the existing payload schema. Third-party corpus text and its large license bundle are not silently republished as MIT application fixtures.

Import the evaluated browser-safe codec without changing the viewer or legacy
transport. Add standalone/Vitest checks, historical benchmark qualifications,
and an unexecuted full-production-auto comparison runner. Keep application,
Worker, and live transport integration as explicit draft deployment gates.
@coderabbitai

coderabbitai Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant