Commit Graph
254 Commits
Author SHA1 Message Date
4DBug 3d01293b82 ws-game: image/vtf (Valve VTF 7.0-7.5 read: every common texel format incl. DXT / ATIxN via codecs/image/Bcn, halves / floats, frames, mips / faces / slices; checked against srctools) 2026-10-31 15:24:50 -05:00
4DBug 7a86e357ed ws-game: image/blp (BLP1 JPEG / palette, BLP2 palette + alpha planes / DXT1-5 via codecs/image/Bcn / BGRA read; BLP2 BGRA write); codecs/image/Jpeg: opts.raw (components without colour conversion, 4th as alpha; additive) 2026-10-31 15:18:41 -05:00
4DBug e5c0873a79 ws-game: image/tim (PlayStation TIM read: 4/8-bit CLUT, 15-bit, 24-bit; write 4/8/16/24-bit) 2026-10-31 15:06:05 -05:00
4DBug 24f471bccb merge ws/tex b32d45e (codecs/image/Bcn + Half, for VTF / BLP) 2026-10-31 15:01:27 -05:00
4DBug 4932fa7148 ws-game: model/bsp (Quake 1 / Half-Life / Quake II brush maps, Quake III maps with patches and lightmaps, entities); core/Input.sibling (opts.files / opts.resolve lookup shared by mdl / bsp / md5 / vpk; additive) 2026-10-31 15:01:06 -05:00
4DBug 9b2b50fe75 ws-game: model/md5 (Doom 3 md5mesh + md5anim: skeleton, weighted bind pose, skin, animations via opts.anims / resolve / files; standalone md5anim) 2026-10-31 14:52:15 -05:00
4DBug 08045ba813 ws-game: model/smd (Valve SMD read + write: skeleton, skin, weights links, frames as animation, animation SMDs); Rig.influences merges a joint listed twice 2026-10-31 14:47:06 -05:00
4DBug f14d5ac4ef ws-game: model/mdl (Quake 1 IDPO: skins via palette, frames as morph targets; Half-Life 1 IDST: bones, skin, body parts, strips / fans, textures with palettes, sequences as animations); Rig.angles, Rig.skeleton returns world matrices 2026-10-31 14:41:33 -05:00
4DBug 50eb827897 ws-game: model/md3 (Quake III MD3 -> Scene: surfaces as primitives, frames as morph targets, tags as nodes with channels, shaders as URIs) 2026-10-31 14:32:47 -05:00
4DBug 897a386c4f merge master (ws/apifix) 2026-10-31 14:25:36 -05:00
4DBug de1d2c2bba ws-game: model/md2 (Quake II MD2 -> Scene: frames as morph targets + grouped animations, skins as URIs); codecs/model/Rig.normals 2026-10-31 14:25:36 -05:00
4DBug 6829c37487 merge ws/apifix 2026-10-31 14:24:12 -05:00
4DBug ec32f359bc ws-game: licenses: blast.c (zlib) for the DCL tables in codecs/compress/Explode 2026-10-31 14:21:50 -05:00
4DBug b02e59809f ws-game: archive/mpq (MPQ v1-4 read: hash / block tables, encryption, listfile names, zlib / implode / bzip2 / LZMA / sparse sectors; Huffman / ADPCM UNSUPPORTED); codecs/compress/Explode (PKWARE DCL implode decompressor, binary + ASCII, tested against StormLib); licenses: blast (format reference) 2026-10-31 14:21:34 -05:00
4DBug 5bbb4227c2 ws-apifix: API.md / STYLE.md / README: music as audio, video as animated image, F.save extra files, variant(r), caps.extraFiles, F.music builder, bitrate in bit/s; type baseline 92 2026-10-31 14:14:11 -05:00
4DBug 6274eedd12 ws-apifix: MP4 AAC length matches ffmpeg: the edit list's length (Track.playDuration) cuts the end padding as well as the priming (codecDelay); a 1 s clip decodes to 44100 frames, not 45056. AudioWrap.trim(dec, skip, length?); the MP4 writer keeps the edit length of copied audio. Video tests compare the whole decoded audio length with ffmpeg (not yet for Matroska) 2026-10-31 14:13:08 -05:00
4DBug 34d0600109 ws-game: archive/vpk (Valve VPK v1 / v2 read incl. multi-part via opts.resolve / opts.files, preload, CRC checks; single-file v1 / v2 write with MD5 section) 2026-10-31 14:09:50 -05:00
4DBug ac47545aa3 ws-apifix: one bitrate unit: every encoder's bitrate option is bit/s (MP3 now too), values below 1000 are kbit/s (the old MP3 values keep working; Opus accepts them too); the MP3 Decoder's bitrate field is bit/s as the Decoder contract says (was kbit/s) 2026-10-31 14:06:51 -05:00
4DBug 5ec3121f65 ws-game: archive/wad (IWAD / PWAD read + write; lumps with namespaces and maps; flats / pictures / composed textures as Images via PLAYPAL; maps as Scenes: triangulated sector floors / ceilings, walls with vanilla alignment, things); codecs/model/Polygon (2D polygons with holes -> triangles); licenses: Freedoom (fixture source only) 2026-10-31 14:05:53 -05:00
4DBug f17a54395d ws-tex: codecs/image/Bcn (BC1-7 decode, BC1/3/4/5 encode) + codecs/image/Half
Decoders ported from Pillow BcnDecode.c (CC0) with D3D11 rules (BC6H +32 rounding, float output, reserved modes,
signed RGTC). Tests against Pillow and Godot 4 (bcdec) over random blocks of every BC6H / BC7 mode; encoder PSNR
above Pillow's encoder. Bench lines in tools/bench.luau.
2026-10-31 14:05:10 -05:00
4DBug 3c2a646365 ws-apifix: type fixes (no new diagnostics) 2026-10-31 14:04:21 -05:00
4DBug 2f0ff81c95 ws-apifix: an outline font saved as BMFont writes its pages (opts.files; without a destination F.save returns them as a third value { [page file] = PNG bytes }; caps.extraFiles); pages named after the destination 2026-10-31 14:03:45 -05:00
4DBug d73b93c740 ws-apifix: videos save as animated images (F.save(video, gif | apng | webp), F.convert(avi, "gif"): frames / fps / maxFrames (300) / maxPixels (2^25)); VideoFrame.index restarts at the seek position; F.detect names WebM files "webm"
api: encoderFor finds image formats for a VideoDecoder, videoToImage() collects the frames; F.detect asks a
format's optional variant(r) for a more precise name (video/mkv: Mkv.variant, from Parse.docType).
codecs/video/Video: index after seek = round(pts * frameRate) + 1.
2026-10-31 14:00:36 -05:00
4DBug eac069f7dc ws-game: archive/grp (Build engine GRP read + write) 2026-10-31 13:56:30 -05:00
4DBug 10bd6b021f ws-apifix: music is audio (F.save / F.convert of a Module or Midi to an audio format renders it, render options from opts; F.audio.open / load render music bytes), F.music builder (ops/MusicOps: new, addPattern, setCell / getCell, addSample, addInstrument, note; also F.ops.music), MIDI writer writes track.name as a 0x03 event
api (init.luau): detectFor() falls back from audio to rendering music formats; encoderFor finds audio formats for
music values; renderMusic() through codecs/audio/Tracker or music/midi render.
2026-10-31 13:56:21 -05:00
4DBug 5af4aa361e ws-game: codecs/model/Rig (morph targets + weights animations, skeletons + skins, influences, joint TRS animations for the game model formats); codecs/image/Pixels.palette (RGB / BGR triples -> u32 palette; additive) 2026-10-31 13:54:43 -05:00
4DBug d41d64219a ws-game: archive/pak (Quake PACK / SiN SPAK read + write); containers/Archive: slice() lazy loader and collect() for simple archive writers (additive) 2026-10-31 13:52:17 -05:00
4DBug 25d8e4ff25 ws-apifix: F.ops.layers.flatten applies the mask of a passThrough group (codecs/image/Blend lerp takes a mask) 2026-10-31 13:50:05 -05:00
4DBug de4f14a343 merge ws/docs 2026-10-31 13:45:55 -05:00
4DBug 23e0c13f52 ws-docs: examples/cad.luau: typed tables (no new type diagnostic) 2026-10-31 13:40:59 -05:00
4DBug 1d21568af8 merge ws/cleanup: restructure C (codecs by domain, shared Chunks/Stream/Pixels/Sniff/Mat4, audio codecs out of format folders, DUP lint, type gate 93), dedup, consistency, F.ops, README 2026-10-31 13:32:16 -05:00
4DBug 3fde582f8c Merge branch 'ws/cleanup' into ws/docs 2026-10-31 13:25:13 -05:00
4DBug fca79bd858 ws-docs: guide pages cad, font, layered, music, playlist, subtitles, tilemap, video; runnable examples per category; README converting note 2026-10-31 13:25:10 -05:00
4DBug 7cfec05eeb ws-cleanup: Pcm.collect reads a known length in one call into the result (no copy); README links the guide
Measured in an A/B of the touched paths (best of 3-4, one core): LuaJIT wav decode through Pcm.drain was ~10%
slower than the old single read; now within noise.
2026-10-31 13:19:43 -05:00
4DBug db81f73acf ws-docs: recipes: MIDI render, glTF to OBJ, vox greedy mesh, zip, CSV, SVG to PNG, TTF bake to BMFont, drawing text 2026-10-31 13:18:01 -05:00
4DBug 0552f0ebf8 ws-docs: guide pages archive, audio, data, image, scene, vector; recipes (first part); docs input generators 2026-10-31 13:16:12 -05:00
4DBug 001e746305 ws-docs: docs/guide/README.md (installing, inputs, detection, errors, options, saving, converting, hosts); LÖVE example: SVG tile, GIF played as a video with a per-update decode budget 2026-10-31 13:09:04 -05:00
4DBug cdcbd76b9e ws-docs: tools/docs_check.py (guide snippets and examples become tests under both runtimes), docs inputs generator 2026-10-31 13:05:43 -05:00
4DBug 9941113b7b ws-cleanup: audio codecs out of the format folders (codecs/audio/Opus, Vorbis, Flac, Mpa)
The decoders / encoders are libraries, not the file format: audio/opus/{Celt, CeltTables, CeltEncoder, Mdct, Packet,
Silk, SilkTables, Decoder} -> codecs/audio/Opus; audio/vorbis/{Codebook, Packet, Setup, Tables} ->
codecs/audio/Vorbis; audio/flac/{Frame, Encode} -> codecs/audio/Flac; audio/mp3/{Core, Tables, Header, Encode2,
Encode3, EncTables, Analysis} -> codecs/audio/Mpa (tools/move.py; code unchanged). Each gets an index init.luau.
The format folders keep the file mapping: Ogg Opus / Ogg Vorbis (headers, granules, seeking, the Vorbis encoder's
Ogg writer), native / Ogg FLAC streams and metadata, ID3 / Xing / the MP3 frame index. docs: STYLE says a codec is
not the format. Full suite: 248 runs pass on both runtimes, lint green.
2026-10-31 12:47:02 -05:00
4DBug f5cf02026d ws-cleanup: MeshFlatten, Zip and the SVG style parser reuse Types.Scene.mul, Types.Date.civilFromDays, Raster.multiply 2026-10-31 12:31:32 -05:00
4DBug 44a599f00c ws-cleanup: codecs/compress/PackBits; UTF-16 and half floats from one place
- codecs/compress/PackBits (new, from image/tiff/Pixels): decode (lenient count + a clean flag for strict callers)
  and encode; image/tiff and layered/psd (which carried its own decoder) use it. tests/codecs/packbits.
- codecs/text/Text.utf16(buf, offset, length, bigEndian?): the UTF-16 -> UTF-8 conversion codecs/font/TrueType,
  archive/7z and layered/psd each wrote (lone surrogates -> U+FFFD everywhere now).
- image/tiff/Pixels and data/cbor use core/Bytes.half instead of their own float16 decoders.
2026-10-31 12:28:33 -05:00
4DBug 51b08575c4 ws-cleanup: codecs/ grouped by domain; containers/Chunks, codecs/audio/Stream, codecs/image/Pixels, codecs/model/Mat4
C2, the hierarchy (tools/move.py, every reference rewritten mechanically):
- codecs/compress: Deflate Lzma Zstd Brotli Bzip2 Lzw; codecs/entropy: Huffman (from core) RangeCoder;
  codecs/image: Jpeg Dct Vp8 Vp8L Yuv Quantize Raster Blend Pixels; codecs/audio: Mdct Aac Alac Pcm Resample
  VorbisComment Tracker SoundFont Stream; codecs/video: H264 Mpeg1 Video; codecs/text: Json Xml Text Url;
  codecs/font: TrueType Cff; codecs/model: MeshFlatten Mat4. containers/ stays flat; core/ keeps Bytes Bits Err
  Crc32 Adler32 Base64 Md5 Input Sniff.
- LAYERS lint: codecs must sit in a domain folder; gen_registry lists codecs by domain (docs/FORMATS.md).
- Checked: build.py both targets, rojo build of build/roblox, the full suite on both runtimes.

C3, generic code out of format folders:
- containers/Chunks (new): the chunked-file walker (RIFF / RIFX / IFF / PNG / CAF layouts: endianness, size first,
  trailer, padding, lenient missing pad, open-ended ids, size hooks). containers/Riff walks with it (RF64 ds64
  through the resize hook); image/png, audio/aiff and audio/caf list their chunk handlers over it.
- codecs/audio/Stream (new): Stream.packets, the packet-decoder Decoder (read / seek with pre-roll / position,
  priming and end trimming) that aac, caf and m4a each carried (~70 lines each).
- codecs/image/Pixels: image/bmp/Pixels promoted (+ rgb555); image/ico's DIB decoder uses its row loops instead of
  its own (the AND mask / alpha rule stay ICO's).
- codecs/model/Mat4 (new): matrices / quaternions / TRS shared by FBX (Xform keeps only the FBX transform model),
  Collada (Math keeps only <lookat> / <skew>) and USD (its matrix helpers and general 4x4 inverse); Mat4.mul is
  Types.Scene.mul. The Collada normal matrix is now the inverse transpose (it was the inverse; same result for the
  fixtures' bind shapes).
- README rewritten (install for Rojo and LÖVE / LuaJIT, quick start per category, F.* and F.ops, host notes:
  FORMATS_NO_JIT_TUNE, paths, layout); docs/STYLE.md: the codec domains, "what belongs in a format folder" with the
  shared building blocks and the DUP rule, conventions (WAVE order, lower-case tags, loops, the api hooks
  decodeImage / encodeImage / openAudio / plugins / resolve, the codecs/video/Video registry), Err.from, the type
  baseline. New tests: tests/containers/chunks, tests/codecs/mat4. Type baseline 93.
2026-10-31 12:25:03 -05:00
4DBug 763f4a7c04 ws-cleanup: shared plumbing: Err.from, core/Sniff, Pcm.drain, Bits.msbPut; DUP lint; tools/move.py
- core/Err.from(message, offset?, kind?): the private-submodule -> Err plumbing (a kind, or a 'code: ' prefix /
  'truncated' / 'past the end' in the message) that Brotli, Bzip2, Zstd, Jpeg, WOFF2, FBX, plist, msgpack and
  bmfont each wrote.
- core/Sniff (new): Sniff.text(r, n, trim?) (the start of a text file without its BOM), Sniff.dropBom(s),
  Sniff.magic(r, s); 13 text formats' sniff / decode BOM handling goes through it.
- codecs/Pcm.drain(dec, source?, maxFrames?): a format's decode() through its open(); the collect-the-Decoder
  loops of aac, aiff, au, caf, flac, m4a, mp3, opus, vorbis and wav are one call each.
- core/Bits.msbPut: the MSB-first bit writer the MP3 / MP2 / FLAC encoders each copied.
- tools/lint_rules.py DUP: a function body of 12+ code lines repeated token for token in another module fails.
- tools/move.py: moves a module and rewrites every reference (requires, deps, headers, fixture INPUTS, docs).
- tools/fixtures/zstd.py: the incompressible corpus is smaller (zstd.luau 15.1 -> 13.4 MB; every fixture module is
  now under 14.3 MB).
- tools/bench.luau: MPEG-1 also runs with the api's LuaJIT trace limits; the sections that compare tuned / default
  limits set them explicitly (jitTune), so the order of sections no longer leaks the tuning.
2026-10-31 12:00:59 -05:00
4DBug 3243404374 ws-cleanup: type diagnostics 1109 -> 94 unique; lint gate against tools/lint_types_baseline.txt
ws/cleanup-types (merged before) annotated Types, init, core, codecs, containers, ops, host and the formats;
this commit fixes the rest in the modules ws-cleanup added (AudioOps, Resample, Vorbis / FLAC / Opus encoders).
tools/lint.sh now counts unique diagnostics (the analyzer printed every required src module twice: master's
'2499' was 1109 unique) and fails when the count rises above tools/lint_types_baseline.txt (94);
LINT_TYPES_UPDATE=1 lowers it.
2026-10-31 11:30:29 -05:00
4DBug 8baa1f1388 ws-cleanup: compat math.clamp through math.min / math.max (LuaJIT)
The branchy compat clamp spawned side traces in hot loops: ~3.5x slower than min(max(x, lo), hi) in a
microbenchmark (NaN still passes through, as in Luau). MPEG-1 320x240 to rgba on LuaJIT (tuned traces):
2.92 -> 2.13 ms/frame.
2026-10-31 11:30:29 -05:00
4DBug 4478332a61 ws-cleanup: merge ws/cleanup-types (type annotations) 2026-10-31 11:27:42 -05:00
4DBug 6b26845afe ws-cleanup: merge master (ws/h264) 2026-10-31 11:12:11 -05:00
4DBug 45bb5f9b95 ws-cleanup: F.ops facade (image / mesh / layers / audio / vector.rasterize) and ops/AudioOps
- F.ops in init.luau, loaded on first use: F.ops.image (ImageOps), F.ops.mesh (MeshOps), F.ops.layers (LayerOps),
  F.ops.audio (new ops/AudioOps), F.ops.vector.rasterize (the vector/svg renderer for any Vector, through F.format).
- ops/AudioOps: toAudio / fromDecoder (Audio from a Decoder via codecs/Pcm), gain / gainDb / normalize, peak / rms,
  remix / downmix / upmix (WAVE-layout matrices, BS.775 coefficients normalised against clipping), resample
  (codecs/Resample), trim, concat and mix (inputs converted to the first one's rate and channels), fade.
- tests/ops/audioops (39 checks, both runtimes); docs/API.md (new): the F.* API, F.ops, hooks, host.
2026-10-31 11:06:04 -05:00
4DBug 8fc0f8a4d8 merge ws/h264 2026-10-31 11:04:09 -05:00
4DBug 06a756212b ws-h264: speed note in the codec header (bench numbers, LuaJIT trace limits) 2026-10-31 11:03:34 -05:00