- HTML 86%
- JavaScript 14%
| audit | ||
| build/wasm-v23 | ||
| dist | ||
| scripts | ||
| src | ||
| tests | ||
| AUDIT.md | ||
| AUDIT_V24.md | ||
| BUILD_REPRODUCIBILITY.md | ||
| COMPLETION_AUDIT.md | ||
| CROSSOVER_BENCHMARK.md | ||
| FIXED96_EXPERIMENT.md | ||
| gpu-kernels-v24.2.6.js | ||
| gpu-kernels.js | ||
| hosted-headers.txt | ||
| hosted-loader.js | ||
| HYBRID_EXPERIMENT.md | ||
| IMPLEMENTATION_REPORT.md | ||
| IMPROVEMENT_PROPOSAL.md | ||
| index.external.html | ||
| index.html | ||
| kernels.js | ||
| MIGRATION_V24.md | ||
| package.json | ||
| README.md | ||
| script-v24.2.6.js | ||
| script.js | ||
| toolchain.lock.json | ||
Mandelbrot Deep Zoom v24.2.8 — Fixed96 True Sparse Queue Experiment
v24.2.8は、v24.2.7で数値バグを修正したFixed96実験を真のsparse GPU実行へ変更した診断版です。DS guarded passが危険pixel indexをGPU queueへcompactし、1-thread finalize passがqueue件数からindirect dispatchを生成、Fixed96 Q8.88 kernelはqueueに入ったpixelだけを処理します。guard→queue→indirect Fixed96の間にCPU readbackはありません。production routerはまだ変更していません。
数値backend
- Direct: WebGPU
f32direct iteration。 - Deep primary: BigInt reference orbit + WebGPU guarded rescaled
f32perturbation。 - Deep correction: primaryで
FIELD_UNKNOWNになったpixelだけ、同じreferenceを用いるdouble-single perturbationで再評価。 - BLA: productionでは未搭載。旧f32量子化BLAでmembership反転を再現したため再導入していません。
- Multi-reference: v24.2開発中に全画面モデルを評価したが、追加referenceの生成/dispatchコストに対してUNKNOWN回収が小さかったためproductionから撤去しました。
Deep primaryはroundoff上界を追跡し、escape/bounded判定を安全に受理できないpixelをUNKNOWNにします。double-single correctionは表示品質回復用であり、任意精度membership証明ではありません。PNG sidecarのmembershipCertifiedは常にfalseです。
Direct / Deep router
単一のzoom閾値でdeepへ切り替えません。
pixel step / f32 ULP < 8ならdirect座標分解能が不足するためdeep必須。- 比率が128以上ならdirectを即採用。
- 8以上128未満のoverlap帯では、本描画前に現在のview専用GPU probeを実行。
- probeではactual full-resolution座標上の複数領域をdirectと「DS補正済みdeep」で比較。
- deep側UNKNOWN率が0.5%以下、escape/bounded分類差0を満たした場合だけ速度比較へ進む。
- reference生成時間を含めてもdeepがdirectより15%以上高速な場合だけdeepを採用。それ以外はdirect。
過去の同深度profileだけで現在viewをdeepへ振ることはありません。profileは診断/平滑化用で、backend選択には現在viewのquality probeを要求します。
Crossover benchmark
診断情報の Backend比較 から、現在のGPUで z0 / 2 / 4 / 6 / 8 / 10 / 12 / 14 / 16 / 20 / 30 / 40 を自動測定できます。
速度測定は全画面を反復実行しません。現在のview座標上の代表3タイル(最大256×144)を測定して ms/pixel を求め、現在のcanvas全体へ換算します。品質比較は別の5領域で実施します。これによりz12以降で全画面Deepを何度も実行してGPU queueが長時間塞がる問題を避けます。reference生成または1回のGPU測定が15秒を超えた場合は明示的に中断します。
比較するbackend:
f32: 現行WebGPU標準。DS: experimental whole-frame double-single Direct。production routerには未接続。Deep warm: BigInt referenceをcache済みとしたDeep primary + DS correction。Deep cold: verified BigInt reference構築 + Deep warm。
結果の時間欄は代表tileからの全画面換算値です。画面表示に加えJSON保存できます。品質のBigInt oracle掃引結果は CROSSOVER_BENCHMARK.md と audit/v24-crossover-quality.json を参照してください。CPUモデルではSeahorse trackでf32がz6付近、DS Directがz10付近からmaterial degradationを示し、DSを中間backendとして試す価値があるという結果です。
Fixed96 Direct experiment
診断情報の Fixed96 Direct実験 から z6 / z8 / z10 / z12 を測定できます。DS Directで |dz/dc| を追跡し、1e11 / 1e12 / 1e13 / 1e14 の各risk thresholdを超えたpixelだけ、reference不要の96-bit符号付きQ8.88固定小数点Directで再評価します。
v24.2.8では補正対象をu32 pixel-index queueへcompactします。queue lengthからdispatchWorkgroupsIndirect()用の1D workgroup数をGPU内で生成し、Fixed96はqueued pixel数だけ実行します。従来の「全画面dispatchして非対象laneをreturn」は廃止しました。
実験システムは各GPU sampleで次をfail-closed検証します。
selected == enqueued == dispatchCount == processed- queue overflow = 0
- indirect workgroup数 =
ceil(enqueued / 64) - invalid/stale queue entry = 0
corrected + remain == processed
1項目でも崩れれば測定値を採用せず実験をエラー停止します。結果表にはcorrectionと実際のdispatch率を別々に表示し、queue=okを確認できます。速度は代表3tileから全画面換算し、品質は5 spatial tilesでcorrected Full Deepと比較します。production routerへは未接続です。
単一ファイル起動
rootの index.html は gpu-kernels.js と script.js を内包した単一HTMLです。ZIP内のHTMLをOSが一時展開して開く場合でも、隣接JSファイルに依存しません。
Deep correction
primary deepでUNKNOWNが残った場合、通常/精細/Strictではsparse double-single correctionを1回実行します。KNOWN pixelはshader冒頭で即returnするため、数値反復はUNKNOWNだけです。省電力モードはUNKNOWNが一定量を超えた場合のみ補正します。
swirly-seahorses-z12の61×39 CPU Math.froundモデルでは:
- primary UNKNOWN: 478 / 2379
- primary false escape: 0
- primary false bounded: 0
- DS correction回収: 478 / 478
- correction後UNKNOWN: 0
- correction false escape / false bounded: 0 / 0
escape iterationは5 pixelでBigInt oracleと差があり、最大差374 iterationでした。このためDS correctionは「見た目と有限iterationの分類回復」であり、Validated相当の保証には使用しません。
UNKNOWN診断
内部metadataではUNKNOWN理由を分離しています。
- error-bound
- escape-uncertain
- reference-end
- rebase-gap
- range
- operation-limit
未補正UNKNOWNはinteriorの完全な黒と別色で表示され、診断欄に理由別件数が出ます。
Export
- 512×512 reusable GPU workspace。
- deep Exportでもprimary後にDS correctionを実行。
- 2×2 AAは各4 sampleをGPUで数値計算→補正→彩色し、GPU resolve後に1回だけreadback。
- 最終画像全体の巨大Canvasは作らず、scanline bandを
CompressionStream('deflate')へ流すstreaming PNG。 - 16384px級の片辺をtile処理可能。
- sidecarに
unresolvedSamplesを記録。
Fallback
WebGPUそのものが利用できない場合だけ軽量JavaScript f64 fallbackを使います。deep zoomはNumber underflow等で誤画像を出さず、「このズーム深度はWebGPUが必要です」と表示して停止します。shader/pipeline failureではCPU全画面rendererへ自動fallbackしません。
Build / test
npm test
npm run build
npm testには以下を含みます。
- WGSL reserved-word scan(9 shader。DS Direct / guarded DS / Fixed96 Direct correctionは実験専用)
- production source/tree contract
- BigInt reference Worker + P/P+64 checkpoint
- f32 direct CPU model
- view固有adaptive backend router policy
- guarded primary deep CPU model
- sparse double-single correction CPU model
- BLA disabled contract
- pixel/export geometry
- e400/e1000 exact coordinate formatting
- streaming PNG CRC/deflate/abort
- real-WebGPU acceptance harnessの静的contract
実GPU受入は tests/webgpu-acceptance.html をWebGPU対応ブラウザで開いて実行します。これはdirect/deep/DS/Fixed96 Direct shader compile、DS correction、Fixed96 smoke、dense既知反例、view-specific router、1×/2×2 Export readback、uncaptured WebGPU errorを検査します。
配布
npm run buildで以下を生成します。
dist/standalone/dist/hosted/
dist/standalone/ は単一 index.html、dist/hosted/ は index.html, gpu-kernels.js, script.js です。root index.html も単一ファイルで、ZIPから展開してそのまま開けます。