Skip to content

Apply the vpin fixes to a table: shrink and repair from the command line #905

Closed

Description

@francisdb

vpin is growing a vpx::fix module next to vpx::audit, see francisdb/vpin#524: &mut VPX mutators that act on what the audit reports and return a record of what they changed, with no I/O, so one write at the end compacts the file. What exists so far is fix::drop_unused_fonts and fix::bitmaps_to_webp; orphan image and sound removal, duplicate and same-data removal and lossless recompression are planned there, and an optimize umbrella with an options builder once a few mutators exist.

vpxtool is the bulk consumer of that. What it would add:

  • a command that applies the fixes to one table or a whole library, rewrites the file and prints what changed per table, with the bytes saved
  • lossless fixes on by default, anything that needs a judgement call (orphan removal, sound dedup) behind a flag
  • images webp moving to the model-side path once vpin moves its png branch there, so the compaction happens in the same write

The lossy tier, resizing for mobile, is #380 and comes after this.

Activity

  1. francisdb commented on Sep 28, 2026

    @francisdb
    OwnerAuthor

    #906 adds vpxtool optimize <table.vpx>, in v0.34.7: the lossless fixes vpin 0.37.2 has (unused fonts dropped, bitmap, png and tga images re-encoded as lossless webp where smaller, FlexDMD images left alone), applied in memory and written back in one go through a temporary sibling file, which also compacts the table. It prints what changed with the bytes saved and what was left alone and why; --dry-run reports without writing. It takes one table by design, a library run is a shell loop away.

    images webp is deprecated in favour of it: hidden from the help and printing a notice for now.

    What remains here waits on the vpin mutators from francisdb/vpin#524: orphan image and sound removal (opt-in, once guarded by every PlaySound and image assignment in the script taking a literal), duplicate-name removal mirroring vpinball, and same-data dedup for images. Each of those gets a flag on optimize when it exists. The lossy tier stays #380.

  2. francisdb commented on Oct 4, 2026

    @francisdb
    OwnerAuthor

    Closing: vpxtool optimize (#906) applies every fix vpin currently has, including --flac for wav sounds (#910). The remaining mutators (orphan image and sound removal, duplicate-name removal, same-data image dedup) are tracked in francisdb/vpin#524; each gets its own flag on optimize once it lands there. The lossy tier stays #380.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions