Skip to content

Audit and enforce cooked-scene preflight ordering #884

Open

Description

@JeanPhilippeKernel

Context and problem

M2's source-independent cooked scene loader is implemented in #879 and tracked by #873. The M2 issue asks for target, version, selected scene, typed closure, capabilities, counts, sizes and path validation before opening or allocating object payloads. The current runtime first captures a verified scene object and then validates the decoded scene against the package (ECS/CookedSceneReconstruction.cpp and ECS/SceneInstance.cpp). Some scene-specific checks necessarily require the contents of that object. The exact achievable ordering and its security/resource implications need an explicit contract; do not assume the current implementation violates a feasible contract without investigating.

Work

  • Trace the real order from Applications/CookedRuntimeReconstruction.cpp through Managers/CookedPackageSnapshot.cpp, object capture, scene decoding and CookedCpuAssetSet loading. Identify the first object open and allocation, and classify each existing validation as manifest-only, scene-content-dependent or device/resource-dependent.
  • Specify which checks can and must run before any payload open; define bounded verified capture and checks that necessarily occur after the scene object is read. Include typed dependency closure, target/format/schema versions, paths, declared sizes/counts, renderer/device capabilities, and failure diagnostics.
  • Implement missing checks at the earliest point that has enough information. Preserve immutable verified bytes, bounded allocations, cancellation and the outgoing scene on rejection. Do not invent a new manifest format or re-cook assets at runtime without separate approval.
  • Reconcile the wording in [Feature] M2: source-independent cooked scene loading and complete first-frame rendering #873 and docs/design/future-plan/scene-runtime-reconstruction.md with the verified contract, including any deliberate exception and why it is safe.

Acceptance and verification

  • Tests instrument object-open and allocation boundaries and demonstrate that manifest-only failures reject before payload access; scene-content-dependent failures reject before dependent assets are admitted.
  • Cover invalid target/version/schema/capability, missing selected scene, incomplete typed closure, invalid paths, oversized metadata, corrupted scene and cancellation; verify stable diagnostics and preservation of the active scene.
  • Document which assumptions require device-specific verification and list remaining unsupported cases. Link the results to [Feature] M2: source-independent cooked scene loading and complete first-frame rendering #873.

This is an audit and implementation task; the ordering gap is confirmed, but the correct policy and any resulting defect have not yet been established.

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

    P2High priority — next sprintarea-renderingenhancementNew feature or requesthelp wantedExtra attention is needed

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions