Observe · Change · Recompute · Explain
从资产契约读到回滚边界
Read-only · exact teaching model
代码页只保留可验证的因果:检查如何影响 QA,变体如何影响内存,依赖如何影响加载,schema 如何决定回滚。
这一课怎么学
- 观察
- 预测
- 改一个量
- 看证据
- 再读代码
Import is a schema boundary
Validate normals, names, UVs and schema before the runtime sees the asset.
// Asset Pipeline Simulator — executable teaching model
const qaScore = 100 - missingChecks - schemaDrift - variantPenalty;
const syncRisk = schemaDrift + dependencyDepth * 0.018 + cacheMisses * 0.1;
const rollbackReady = applyMode !== "apply" && schemaVersion === requiredSchema;Variants multiply memory and submissions
Shared materials and atlases are quality-budget decisions.
const textureFactor = (textureResolution / 1024) ** 2;
const peakMemoryMb = textureFactor * 4 * materialSlots * (sharedMaterial ? 1 : variants);
const drawCalls = sharedMaterial ? ceil(materialSlots / 4) : materialSlots * variants;
Loading is a dependency graph
Cache misses and depth explain why a small bundle can still be slow.
const loadMs = base + bundles * 4 + dependencyDepth * 3 + cacheMisses * 40;
const reportId = stableHash({ schemaVersion, qaScore, loadMs, rollbackReady });