Optimization experiment: unique-debug

Measured artifact comparison ยท moonsize

Interpretation

Delta = current minus baseline. Negative means fewer bytes.

Declared build comparability: same-declared-settings. Different fields: [].

Business validation (self-reported): passed. A smaller artifact alone does not establish a successful optimization.

Self-reported; moonsize did not execute builds or business validation.

Measured sizes

BytesBaselineCurrentDelta
Whole file1082410168-656
Whole-file gzip52364999-237

Gzip errors: baseline none; current none.

Artifacts and graph diagnostics

Graph completeness concerns the current model; it does not certify deletion safety.

baseline

{
  "path": "_build\\retained-boundaries\\unique-debug\\before.wasm",
  "sha256": "388aa4712779c8d7501bb28f462e8298e27dbf6713fc2646563c97da2f0b8dd3",
  "raw_bytes": 10824,
  "whole_gzip_bytes": 5236,
  "gzip_error": null,
  "graph_complete": true,
  "diagnostics": []
}

current

{
  "path": "_build\\retained-boundaries\\unique-debug\\after.wasm",
  "sha256": "319c48a4338e00e1387f298f2a0b7a65294b035a72b720a67cd89ac01019b1e9",
  "raw_bytes": 10168,
  "whole_gzip_bytes": 4999,
  "gzip_error": null,
  "graph_complete": true,
  "diagnostics": []
}
Build and business validation record (self-reported)
{
  "title": "Optimization experiment: unique-debug",
  "hypothesis": "MoonBit source rebuild; same project path, toolchain and flags; optional call removed",
  "baseline": {
    "command": "moon build --target wasm --debug --no-strip",
    "toolchain": "moon 0.1.20260915 (2e1a46d 2026-09-15) ~\\.moon\\bin\\moon.exe\nmoonc v0.10.13+cbb11c36f (2026-09-15) ~\\.moon\\bin\\moonc.exe\nmoonrun 0.1.20260915 (2e1a46d 2026-09-15) ~\\.moon\\bin\\moonrun.exe\n\nFeature flags enabled: rr_moon_mod,rr_moon_pkg",
    "target": "wasm",
    "mode": "debug",
    "strip": false,
    "features": [],
    "revision": "b406697ea67260a1423e5406d0f1352e6e3cdba3cecd38b57df21f1f37458ae6"
  },
  "current": {
    "command": "moon build --target wasm --debug --no-strip",
    "toolchain": "moon 0.1.20260915 (2e1a46d 2026-09-15) ~\\.moon\\bin\\moon.exe\nmoonc v0.10.13+cbb11c36f (2026-09-15) ~\\.moon\\bin\\moonc.exe\nmoonrun 0.1.20260915 (2e1a46d 2026-09-15) ~\\.moon\\bin\\moonrun.exe\n\nFeature flags enabled: rr_moon_mod,rr_moon_pkg",
    "target": "wasm",
    "mode": "debug",
    "strip": false,
    "features": [],
    "revision": "421adaf93cd02f8cbea399093a9b38f147b3a02526f9884400ac63060c9fd268"
  },
  "validation": {
    "status": "passed",
    "command": "node scripts/demo-retained-boundaries.mjs",
    "notes": "Base output is preserved; optional output is intentionally removed. Rollback restores exact Wasm bytes and complete output. This is not full behavioral equivalence."
  }
}

Section changes

SIZE COMPARISON

                      baseline  current  delta
  total                  10824    10168  -656  (-6.0%)
  code                    5068     5001  -67  (-1.3%)
  custom (name)           4846     4667  -179  (-3.6%)
  data                     628      220  -408  (-64.9%)
  custom (producers)        71       71  0  (0.0%)
  type                      59       59  0  (0.0%)
  function                  50       48  -2  (-4.0%)
  import                    37       37  0  (0.0%)
  export                    21       21  0  (0.0%)
  global                    13       13  0  (0.0%)
  element                    8        8  0  (0.0%)
  table                      7        7  0  (0.0%)
  memory                     5        5  0  (0.0%)
  datacount                  3        3  0  (0.0%)

Functions, packages and matching coverage

FUNCTION SIZE CHANGES

  Encoded bytes = body length prefix + locals + instructions.
  TOTAL                 BASELINE       CURRENT         DELTA
  file                     10824         10168          -656
  function encoding          5064          4997           -67

  STATUS          BASE_INDEX  CURRENT_INDEX  BASE_ENCODED   CUR_ENCODED         DELTA  RAW_SYMBOL
  removed-symbol          36              -            29             0           -29  "_M0FP24demo18retainedboundaries14boundary__leaf"
  removed-symbol          35              -            23             0           -23  "_M0FP24demo18retainedboundaries16boundary__target"
  matched                 47             45            84            69           -15  "_M0FP017____moonbit__main"
  matched                 42             40           122           122             0  "_M0FPB12dec__count32"
  matched                 41             39            40            40             0  "_M0FPB12hex__count32"
  matched                 40             38            65            65             0  "_M0FPB14radix__count32"
  matched                 43             41           633           633             0  "_M0FPB20int__to__string__dec"
  matched                 45             43           227           227             0  "_M0FPB20int__to__string__hex"
  matched                 44             42           266           266             0  "_M0FPB24int__to__string__generic"
  matched                 37             35            24            24             0  "_M0FPB7printlnGsE"
  matched                 46             44             4             4             0  "_M0FPC15abort5abortGuE"
  matched                 38             36             9             9             0  "_M0IPC16string6StringPB4Show10to__string"
  matched                 39             37           301           301             0  "_M0MPC13int3Int18to__string_2einner"
  matched                 26             26            80            80             0  "moonbit.add_string"
  matched                 17             17            11            11             0  "moonbit.array_length"
  matched                 28             28            49            49             0  "moonbit.decref"
  matched                 33             33           206           206             0  "moonbit.fprintln"
  matched                 10             10            82            82             0  "moonbit.free"
  matched                 29             29           409           409             0  "moonbit.gc.free"
  matched                 11             11            30            30             0  "moonbit.gc.malloc"

PACKAGE SIZE CHANGES

  Best-effort symbol package attribution; includes unmatched functions.
  package totals:         5064          4997           -67

  BASE_FUNCS  CURRENT_FUNCS  BASE_ENCODED   CUR_ENCODED         DELTA  PACKAGE
           2              0            52             0           -52  "demo::retainedboundaries"
           8              8          1461          1446           -15  "(top-level)"
           1              1             4             4             0  "abort"
           1              1           301           301             0  "int::Int"
          22             22          1030          1030             0  "moonbit"
           2              2           439           439             0  "moonbit.gc"
           1              1           482           482             0  "moonbit.utf8"
           2              2           111           111             0  "moonbit.wasi"
           1              1             9             9             0  "string::String::Show"
           7              7          1175          1175             0  "tlsf"

MATCHING SUMMARY

  CATEGORY          BASE_COUNT   CUR_COUNT    BASE_BYTES     CUR_BYTES
  matched                   45          45          5012          4997
  added-symbol               0           0             0             0
  removed-symbol             2           0            52             0
  ambiguous                  0           0             0             0
  missing-symbol             0           0             0             0

  Matched coverage: baseline 95.7% of functions / 98.9% of encoded bytes; current 100.0% of functions / 100.0% of encoded bytes.
  Only symbols unique on both sides are matched. Added/removed symbols may reflect renames or toolchain changes, not source additions/deletions.
  Function delta = matched -15 + added 0 - removed 52 + unmatched current 0 - unmatched baseline 0 = -67 B.

CODE OVERHEAD

  RAW BYTES             BASELINE       CURRENT         DELTA
  code section              5068          5001           -67
  function encoding          5064          4997           -67
  code overhead                4             4             0

  Code overhead includes the section header and function-count encoding.
  Function changes do not sum to file changes; see the existing section comparison for name, data and other sections.

Measurement boundaries

Raw and whole-file gzip deltas measure only these supplied artifacts. Gzip uses bikallem/compress defaults, not a measured network transfer. Function/package differences use encoded bytes and best-effort symbol identity. Build declarations do not prove controlled conditions or behavioral equivalence.

Direct calls, including direct tail calls, use exact targets; table calls use static element candidates. Reference-call targets and dynamic table contents are not solved. Imported/exported tables, runtime writes and explicit initializers are conservatively diagnosed, even with static candidates. Element references are conservative roots, including private, passive and declarative segments. graph_complete means no gaps detected within this scope, not full Wasm certification. RETAINED sums dominated encoded function bytes within the current graph/root model. It does not predict recompiled file reduction or whole-file gzip savings, even when --strict passes.