Skip to content

feat: fetch scene files from asset bundle CDN instead of catalyst#7833

Open
decentraland-bot wants to merge 13 commits intodevfrom
fix/7625-cdn-scene-files
Open

feat: fetch scene files from asset bundle CDN instead of catalyst#7833
decentraland-bot wants to merge 13 commits intodevfrom
fix/7625-cdn-scene-files

Conversation

@decentraland-bot
Copy link
Copy Markdown

@decentraland-bot decentraland-bot commented Mar 26, 2026

Pull Request Description

What does this PR change?

When a scene has asset bundles available, redirects its core files (main script, scene.json, main.crdt) to the asset bundle CDN instead of the catalyst. Before fetching from CDN, performs parallel HEAD requests to validate all three files exist — if any is missing, falls back entirely to catalyst (all-or-nothing).

This is done by injecting CDN URL overrides directly into SceneHashedContent via a new OverrideContentUrl method.

Scenes marked as fallback could fail to load because files were missing from the catalyst. Routing requests to the CDN — where the asset-bundle-converter uploads them — eliminates this class of failure.

Addresses #7625

Test Instructions

Prerequisites

  • Use a build from this branch

Test Steps

  1. Go to Genesis Plaza in zone (the scene has already been rebuilt with CDN files available)
  2. Verify the scene loads correctly and all content renders as expected
  3. Go to Genesis Plaza in org
  4. Verify the scene also loads correctly — in this case CDN files are not available, so it should fall back to catalyst seamlessly
  5. Navigate to other scenes and verify normal loading behavior is not affected

Additional Testing Notes

  • The fallback is all-or-nothing: if any of the three HEAD requests fail, all files come from catalyst
  • CDN URL pattern: {assetBundleURL}/{abVersion}/{entityId}/{fileName}
  • The main script file name is taken from definition.metadata.main (not hardcoded to index.js)

Quality Checklist

  • Changes have been tested locally
  • Documentation has been updated (if required)
  • Performance impact has been considered
  • For SDK features: Test scene is included

Code Review Reference

Please review our Code Review Standards before submitting.

…atalyst

When a scene has an asset bundle manifest version (i.e. it has been processed
by the asset-bundle-converter and is served from the registry), redirect
index.js and main.crdt downloads to the asset bundle CDN (S3) instead of
fetching them from the catalyst.

Changes:
- SceneHashedContentWithCDN: new ISceneContent decorator that overrides the
  URL for the main script (index.js) to point to the CDN.
- LoadSceneSystemLogic: returns SceneHashedContentWithCDN when the scene has
  an AB manifest, so the V8 runtime fetches index.js from the CDN.
- LoadSceneSystemLogicBase.LoadMainCrdtAsync: tries the CDN URL first for
  main.crdt, falls back to the catalyst URL on any error (e.g. conversion
  still in progress).

CDN URL pattern: {assetBundleURL}{abVersion}/{entityId}/{fileName}

This eliminates a class of incidents where a scene marked as fallback could
not load because its index.js or main.crdt files were missing from the
catalyst.

Closes #7625
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 26, 2026

@dalkia dalkia changed the title feat: fetch index.js and main.crdt from asset bundle CDN instead of catalyst feat: fetch scene files from asset bundle CDN instead of catalyst Mar 26, 2026
@AnsisMalins
Copy link
Copy Markdown
Contributor

feat: fetch scene files from asset bundle CDN instead of catalyst

PR number: 7833
Windows change build
Windows baseline build
macOS change build
macOS baseline build

Intel Core i3

Change samples: 2680
Baseline samples: 2679

Metric Change Baseline Delta Improvement
CPU average 33.5 ms 33.5 ms -0.0 ms 0.1%
CPU 1% worst 49.3 ms 51.1 ms -1.8 ms 3.5% 🟢
CPU 0.1% worst 101.7 ms 114.5 ms -12.8 ms 11.1% 🟢
GPU average 15.7 ms 15.6 ms 0.2 ms -1.0%
GPU 1% worst 21.6 ms 20.3 ms 1.3 ms -6.5% 🔴
GPU 0.1% worst 25.8 ms 22.5 ms 3.4 ms -15.0% 🔴

@AnsisMalins
Copy link
Copy Markdown
Contributor

PR #7833, run #23950079654

Builds: Windows change, Windows baseline, macOS change, macOS baseline

Intel Core i3

Metric Change Baseline Delta Improvement
Samples 2675 2674
CPU average 33.6 ms 33.6 ms -0.0 ms 0.0%
CPU 1% worst 54.5 ms 55.7 ms -1.2 ms 2.2%
CPU 0.1% worst 102.3 ms 136.0 ms -33.7 ms 24.8% 🟢
GPU average 16.3 ms 15.3 ms 1.1 ms -7.0% 🔴
GPU 1% worst 22.7 ms 22.3 ms 0.5 ms -2.0%
GPU 0.1% worst 31.1 ms 28.0 ms 3.1 ms -11.2% 🔴

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants