Convert OMG4 conversion script from Python to TypeScript#2
Open
Copilot wants to merge 4 commits into
Open
Conversation
- Add missing JSDoc @param descriptions and @returns declarations - Reorder function definitions to fix no-use-before-define errors - Remove async from convertOmg4 (no await expressions) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: sipkode <19314267+sipkode@users.noreply.github.com>
Co-authored-by: sipkode <19314267+sipkode@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Convert OMG4 script to TypeScript for command line use
Convert OMG4 conversion script from Python to TypeScript
Mar 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
scripts/xz_to_omg4.pyconverter was written in Python — wrong language for a TypeScript project. Rewrites the full.xz→.omg4pipeline in TypeScript, places it in/src/lib/alongside existing readers/writers, and wires it into the CLI.New modules (
src/lib/omg4/)pickle-helpers.ts— Extracts numpy ndarrays from pickleparser output (float16→float32 conversion, latin1 bytes decoding, shape/dtype handling)huffman.ts— Bitstream decoder compatible with dahuffman'scode_tableformatmlp.ts— CPU-side FullyFusedMLP forward pass, sinusoidal frequency encoding, unisphere contraction, quaternion normalizationconvert-omg4.ts— Orchestrator: LZMA decompress → pickle parse → VQ decode → per-frame MLP inference → pack binary.omg4writers/write-omg4.ts— FileSystem-integrated writer wrapping the converterCLI integration
.xzregistered as input format,.omg4as output format--omg4-frames,--omg4-fps,--omg4-time-min,--omg4-time-maxglobal options.xz → .omg4path detectedDependencies
@napi-rs/lzma— LZMA/XZ decompression (Rust NAPI bindings)pickleparser— Python pickle format parser (pure JS)Both marked as external in rollup config since they're Node.js-specific.
Tests
16 tests covering pickle helpers, Huffman decoding, MLP math, and end-to-end
.xz → .omg4conversion with a synthetic checkpoint fixture.🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.