@vitreajs/vitrea 0.4.0 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -490,6 +490,24 @@ interface GlassGroupState {
490
490
  readonly analysis: AnalysisQuality;
491
491
  readonly health: GroupHealth;
492
492
  readonly demotionReason?: DemotionReason;
493
+ /**
494
+ * Which body the CSS tier drew for this group, where the CSS tier is the one
495
+ * drawing (W16 G1).
496
+ *
497
+ * `two-layer` is the material: a sharp `backdrop-filter` and a heavy one over
498
+ * it, mixed by the renderer's own depth ramp. `collapsed` is the declared
499
+ * degradation the cost budget buys — the heavy layer folded into the single
500
+ * mixed σ this tier drew before W16 — and it is named here for the same reason
501
+ * every other field on this record is: a capture cell, a readout and a test
502
+ * must read what actually drew rather than what was asked for. Absent on a
503
+ * WebGPU-tier group, and on any group before the first frame has resolved one.
504
+ *
505
+ * Resolved by the platform rather than by core's resolver: the budget is a
506
+ * measurement of the root's total filtered area, which core cannot see. The
507
+ * platform folds it onto the state on the one function every consumer goes
508
+ * through.
509
+ */
510
+ readonly cssBody?: "two-layer" | "collapsed";
493
511
  }
494
512
  declare function isHealthy(state: GlassGroupState): boolean;
495
513
 
@@ -2031,6 +2049,111 @@ interface MaterialProfile {
2031
2049
  * 0.0174.
2032
2050
  */
2033
2051
  readonly sizeScatterSpanMax: number;
2052
+ /**
2053
+ * **The body's second scale** (W15 G1, from the measurement of claims §5.69
2054
+ * §1–§2) — the heavy width's gain, the deep value's floor and the deep
2055
+ * value's span top, each read again at dpr 2.
2056
+ *
2057
+ * At 2x the reference's body is a different object from the one the three
2058
+ * constants above describe, and §5.69 measured all of it: the deep interior
2059
+ * is FULLY heavy on the two largest spans and 0.90–0.95 heavy on `rrect-md`
2060
+ * (§2), where the 1x span curve leaves a sharp share of 0.24–0.36 there, and
2061
+ * the heavy component's own width is 8–11 device px against the 1x law's 10
2062
+ * CSS px (§1). One curve fitted at 1x cannot be both, so the deep value's two
2063
+ * constants and the gain get a second reading rather than a scale factor —
2064
+ * the same shape the ramp's anchors already have.
2065
+ *
2066
+ * Each is interpolated by `rampAtScale`: held at the 1x constant at dpr ≤ 1,
2067
+ * at this one from dpr 2 up, linear between. **At dpr 1 every one of them is
2068
+ * inert by construction, whatever it says** — W15's binding rule — so the 1x
2069
+ * material is byte-identical to the W13 bed and the landing's confirmation
2070
+ * measured exactly that: 49 of 49 1x GPU cells identical to the bed with
2071
+ * every capture byte-identical (claims §5.70 §8).
2072
+ *
2073
+ * Consumed at draw time, not folded into a constant: `scatterDeepThickness`
2074
+ * takes the ratio for the floor and the span top, the renderer resolves all
2075
+ * three from the viewport's own ratio and hands them to the optics pass
2076
+ * through the uniforms the shader already reads (`scatter.x`, `lensOval.w`
2077
+ * and `size.x`), and `scatterThickness`, `scatterSharpShare` and the ramp's
2078
+ * area-average projection read the resolved deep value.
2079
+ *
2080
+ * **FITTED** by W15 G1's runtime sweep at
2081
+ * `--profile apple-macos-26.5-2x-light-standard` on the calibration set, the
2082
+ * holdout untouched, and landed at the values below (claims §5.70 §2 and §8;
2083
+ * the four sweeps `results/2026-09-04-w15-body-2x/g1/stage1..stage3` and the
2084
+ * confirmation `confirm-3`, whose 2x holdout was read once for this
2085
+ * configuration). The rule W13 wrote after the paper model over-credited the
2086
+ * mip chain's heavy tap (§5.58 §1) held: no constant here lands on a paper
2087
+ * prediction, and the sweep contradicted the paper estimate.
2088
+ *
2089
+ * **The gain, 4.8.** Stage 2c swept it over 4.0 / 4.4 / 4.8 / 5.2 at the
2090
+ * chosen base and found an INTERIOR MINIMUM at 4.8 — the interior spread
2091
+ * against native reading 0.0335 / 0.0214 / 0.0120 / 0.0217 with the band's
2092
+ * rise at its top too. Through `bodySigmaCssFor` that is a heavy width of
2093
+ * **6 device px** at dpr 2, NARROWER than the 8–11 device px §5.69 §1
2094
+ * bounded as a Gaussian: the estimator carries ±40% on a real capture of a
2095
+ * known law (§5.69 §3) and the mip chain's tap is not a Gaussian, so the
2096
+ * renderer is the fitting instrument and 6 is the width it draws best.
2097
+ *
2098
+ * **The floor, 1.0** — the deep value FULLY heavy at dpr 2, which is what
2099
+ * G0's deep windows read on the two largest spans (§5.69 §2). `kDeep` is
2100
+ * therefore 1 at every span at this ratio, and the depth ramp above it is the
2101
+ * whole body (§5.70 §1).
2102
+ *
2103
+ * **The span top, 256** — the 1x value, unchanged, because a floor of 1
2104
+ * leaves the deep value nothing to rise to and the top has no work at this
2105
+ * ratio. Stage 1 swept it against 128 and the bed did not ask for the change.
2106
+ */
2107
+ readonly sizeScatterGainMax2x: number;
2108
+ readonly sizeScatterFloor2x: number;
2109
+ readonly sizeScatterSpanMax2x: number;
2110
+ /**
2111
+ * **The heavy width's gain at the TOP of the scatter span curve, at dpr 2**
2112
+ * (W15 G1's re-form, from claims §5.70 §4 and §7 and the measurement of
2113
+ * §5.69 §1) — the second-scale term that lets the 2x heavy width GROW with
2114
+ * the span instead of being one number for the whole bed.
2115
+ *
2116
+ * `sizeScatterGainMax2x` above is one gain at dpr 2, and the sweep that fitted
2117
+ * it read the calibration cells, whose spans are 32–128. The reference's heavy
2118
+ * kernel is not one width: §5.69 §1's bounded per-span fit reads 8.0 / 7.5 /
2119
+ * 8.0 / 9.0 / 11.0 device px across the bed's spans, a ratio of 1.375 between
2120
+ * span 160 and span 96. Landing the single gain accordingly left the largest
2121
+ * span's deep interior about 40% too structured (`rrect-lg` at 2x, spread
2122
+ * 0.1134 against the reference's 0.0810, claims §5.70 §4) while every smaller
2123
+ * cell rose. So the gain takes a second grading, in SPAN:
2124
+ *
2125
+ * ```
2126
+ * gain(span, dpr) = gainAtScale(dpr)
2127
+ * + (gainFar(dpr) − gainAtScale(dpr))
2128
+ * · smoothstep(sizeSpanMax, sizeScatterSpanMax(dpr), span)
2129
+ * ```
2130
+ *
2131
+ * with `gainAtScale` the existing `scatterGainAtScale` and `gainFar` this
2132
+ * constant interpolated by `rampAtScale` from `sizeScatterGainMax`. The curve
2133
+ * is not a new span statistic: it is the same smoothstep the fourth form's
2134
+ * far-anchor decline already rides (`scatterRampStart`), so the width and the
2135
+ * ramp's start move along one curve above the thickness knee.
2136
+ *
2137
+ * **Inert at dpr 1 by construction.** `gainFar` interpolates from
2138
+ * `sizeScatterGainMax` — the 1x gain, not this constant — so at dpr ≤ 1 the
2139
+ * far gain IS the base gain and the whole term is a flat no-op whatever this
2140
+ * says. That is W15's binding rule (the 1x material does not move) discharged
2141
+ * by the shape of the formula rather than by a capture.
2142
+ *
2143
+ * **LANDED at 9.9** (claims §5.70 §8; W15 Decision Log 3, the user's landing
2144
+ * "the re-form"), and the value is G0's rather than the holdout row's: §5.69
2145
+ * §1's bounded per-span reading is 8 device px at span 96 and 11 at 160, a
2146
+ * ratio of 1.375, and this curve reads 0.352 at span 160, so 4.8 + (9.9 −
2147
+ * 4.8) · 0.352 reproduces that ratio over the base gain of 6 device px. The
2148
+ * heavy width at dpr 2 is therefore 6.0 device px at spans ≤ 96, 6.7 at 128,
2149
+ * 8.2 at 160 and 12.4 at 256 and beyond. The calibration cells neither chose
2150
+ * the value nor rejected it — `stage3` swept 4.8 / 7.5 / 9.9 / 12.5 and only
2151
+ * `rrect-ml` (span 128, a tenth of the grading) moves, its interior spread
2152
+ * 0.1125 → 0.0993 against native 0.1018 at 9.9, which is the sweep's best on
2153
+ * its own objective. The confirmation's holdout `rrect-lg` rose 0.9661 →
2154
+ * 0.9762 with its interior spread 0.0721 against native 0.0810.
2155
+ */
2156
+ readonly sizeScatterGainFar2x: number;
2034
2157
  /**
2035
2158
  * **The body's depth ramp** (W13 G1, from the measurement of claims §5.61 §2
2036
2159
  * and the re-forming its runtime sweep forced) — a near-contour excursion on
@@ -2113,15 +2236,15 @@ interface MaterialProfile {
2113
2236
  * + (far − thick) · smoothstep(sizeSpanMax, sizeScatterSpanMax, span)
2114
2237
  *
2115
2238
  * Two curves the material already has, one more constant per scale, and no
2116
- * new span statistic. At 2x `far` sits below the thick anchor, so the null
2117
- * the third form verified bit-exactly (§5.67 §2) holds by construction: an
2118
- * excursion that was zero at every span stays zero when its start falls
2119
- * further.
2239
+ * new span statistic. At 2x the decline is switched off rather than inverted:
2240
+ * `far` and `thick` carry the same number since W15 G1, because G0 read the
2241
+ * reference's 2x start FLAT across the thick spans (claims §5.69 §2, §5.70 §6
2242
+ * (iv)) — the decline is a 1x feature of this form.
2120
2243
  *
2121
- * PROVISIONAL, all eight. The runtime sweep at this form sets them, because
2122
- * the paper model over-credited the mip chain's heavy tap once already
2123
- * (§5.58 §1) and no constant lands on a paper prediction again. What they
2124
- * carry now:
2244
+ * The 1x three are FITTED (W13 G1's third and fourth sweeps) and the 2x four
2245
+ * are FITTED or read from G0 by W15 G1 (claims §5.70 §2 and §8); no constant
2246
+ * here lands on a paper prediction, because the paper model over-credited the
2247
+ * mip chain's heavy tap once already (§5.58 §1). What they carry:
2125
2248
  *
2126
2249
  * **1x — thin 0.64, thick 0.52, reach 120 device px.** G0's own start
2127
2250
  * readings are 0.637 on `rrect-sm` and 0.642 on the capsule at the thin end
@@ -2132,20 +2255,27 @@ interface MaterialProfile {
2132
2255
  * and is also G0's reading on that cell, so the fit is not traded against the
2133
2256
  * form's own arithmetic.
2134
2257
  *
2135
- * **2x — thin 0.46, thick 0.17, reach 100 device px, and the excursion clamps
2136
- * to zero on every cell of the calibration bed.** These are G0's 2x readings
2137
- * (0.483 / 0.437 on the thin cells, 0.192 / 0.179 / 0.141 on the thick ones),
2138
- * and every one of them sits BELOW its cell's deep sharp share: the implied
2139
- * excursions run −0.095 to −0.289 (claims §5.64 §4). `max(0, s₀ − sDeep)` is
2140
- * therefore zero everywhere on this bed at dpr 2. That is not a special case
2141
- * and not a disabled facet — it is the law evaluating to no excursion where
2142
- * the reference's own contour share is heavier than vitrea's deep value. It
2143
- * follows that **the 2x gap is a deep-value gap and not a ramp gap**: the
2144
- * span law's floor, knee and top are what miss at that scale, and no
2145
- * one-signed excursion above them can express it. That fit is W13's Deferred
2146
- * charter and not this constant's business.
2147
- *
2148
- * **far — 0.20 at 1x (FITTED on the W14 bed), 0.15 at 2x.** The fourth
2258
+ * **2x — thin 0.46, thick 0.21, far 0.21, reach 100 device px, and the ramp
2259
+ * is now the WHOLE body above the deep value** (W15 G1, claims §5.70 §1–§2).
2260
+ * W13 left these inert for the deep value's sake: at `sizeScatterFloor2x` 0.4
2261
+ * every anchor sat below its cell's deep sharp share and `max(0, s₀ − sDeep)`
2262
+ * was bit-exactly zero on the whole bed. W15 G1 fitted that deep value fully
2263
+ * heavy (`sizeScatterFloor2x` 1.0), so the deep sharp share at dpr 2 is 0 and
2264
+ * the anchors act on the numbers they were carrying — which is why the wave's
2265
+ * three gaps turned out to be one gap (§5.70 §6 (i)).
2266
+ *
2267
+ * The values are G0's readings where the sweep was flat and the sweep's where
2268
+ * it was not. **Thin 0.46** is G0's u 6 reading exactly (0.494 / 0.468 on the
2269
+ * thin cells) and stage 2b's best, over a top nine points within 0.002 of
2270
+ * each other. **Thick and far 0.21**: G0's 2x starts on the thick cells are
2271
+ * 0.163 / 0.199 / 0.210 at their own widths and 0.192 / 0.199 / 0.195 at one
2272
+ * common width — flat with span, not declining — so the two anchors take one
2273
+ * number and the fourth form's decline is off at this scale; stage 2a
2274
+ * measured the objective flat over 0.17–0.25 and worse at 0.33. **Reach 100
2275
+ * device px** = 50 CSS px against G0's measured 49 / 53 / 56, and stage 2b
2276
+ * found 100 and 130 indifferent.
2277
+ *
2278
+ * **far — 0.20 at 1x (FITTED on the W14 bed), 0.21 at 2x.** The fourth
2149
2279
  * sweep (`results/2026-09-03-w13-ramp/g1/sweep-4/`) swept far over eight
2150
2280
  * points from 0.52 (the third form) down to 0.15: S1 and S4 pass at every
2151
2281
  * one, only `rrect-ml`'s rows move and they improve monotonically as far
@@ -2155,8 +2285,14 @@ interface MaterialProfile {
2155
2285
  * is far = 0.207 through this form — and 0.20 is the measured grid point that
2156
2286
  * carries it. The confirmation read `rrect-lg` at `ssimMean` +0.0056 against
2157
2287
  * the W14 bed (the third form: −0.0026) with its interior 12% over the
2158
- * reference (from 33% over). At 2x far is below the thick anchor so that the
2159
- * null holds — re-verified bit-exact under this form.
2288
+ * reference (from 33% over). At 2x far equals the thick anchor, so the start
2289
+ * is flat past the knee at that scale — G0's own reading (§5.69 §2), and the
2290
+ * holdout's band supports it (`rrect-lg` +0.0106, claims §5.70 §8).
2291
+ *
2292
+ * At dpr 1 none of the 2x four is read at all: `rampAtScale` holds every one
2293
+ * of them at its 1x anchor below dpr 1, so the 1x material is byte-identical
2294
+ * to the W13 bed and the landing's confirmation measured that on 49 of 49 1x
2295
+ * GPU cells (claims §5.70 §8).
2160
2296
  */
2161
2297
  readonly sizeScatterRampStartThin1x: number;
2162
2298
  readonly sizeScatterRampStartThick1x: number;
@@ -2438,6 +2574,10 @@ interface MaterialProfilePatch {
2438
2574
  readonly sizeScatterGainMax?: number;
2439
2575
  readonly sizeScatterFloor?: number;
2440
2576
  readonly sizeScatterSpanMax?: number;
2577
+ readonly sizeScatterGainMax2x?: number;
2578
+ readonly sizeScatterFloor2x?: number;
2579
+ readonly sizeScatterSpanMax2x?: number;
2580
+ readonly sizeScatterGainFar2x?: number;
2441
2581
  readonly sizeScatterRampStartThin1x?: number;
2442
2582
  readonly sizeScatterRampStartThick1x?: number;
2443
2583
  readonly sizeScatterRampStartFar1x?: number;
package/dist/index.js CHANGED
@@ -1092,7 +1092,7 @@ function isHealthy(state) {
1092
1092
 
1093
1093
  // src/renderer-seam.ts
1094
1094
  async function loadWebGPURendererModule() {
1095
- return import('./dist-RGWZAZ6J.js');
1095
+ return import('./dist-OHNXYEZP.js');
1096
1096
  }
1097
1097
  async function loadWebGPURenderer() {
1098
1098
  const { createWebGPURenderer } = await loadWebGPURendererModule();