Skip to content

fix: repoint avatar preview renderer to renderfeatures main, and fix GeoffNoise.hlsl import error - #9956

Merged
mikhail-dcl merged 2 commits into
devfrom
fix/renderer-renderfeatures-repin
Sep 4, 2026
Merged

fix: repoint avatar preview renderer to renderfeatures main, and fix GeoffNoise.hlsl import error#9956
mikhail-dcl merged 2 commits into
devfrom
fix/renderer-renderfeatures-repin

Conversation

@mikhail-dcl

Copy link
Copy Markdown
Collaborator

Pull Request Description

What does this PR change?

Two leftovers from the Unity 6.5 upgrade (#9871), both found on dev after it merged. Unrelated to each other, bundled at request — 3 files, 11 insertions.

1. Avatar Preview Renderer still pinned to a deleted branch

The upgrade pinned decentraland.renderfeatures to #chore/unity-6-5 in avatar-preview-renderer/Packages/manifest.json so the renderer could consume the 6.5 fixes before they landed. That branch merged as unity-explorer-packages#62 and was auto-deleted; Explorer's pin was moved back to main, the renderer's was not.

It resolves today only by luck: the locked hash 4426b066 is an ancestor of main (behind by 3), so UPM checks it out by SHA from packages-lock.json. Evidence it currently works — the renderer build on dev at 78705998 succeeded at 12:29Z, 80 minutes after the branch was deleted at 11:09Z. It breaks as soon as packages-lock.json is regenerated or dropped, because UPM then has to resolve the branch ref and gets a 404.

Dropping the pin and relocking onto 04b022e9 makes the entry byte-identical to Explorer's, so both projects consume the same RenderFeatures. It also picks up 1691b33d (gate skybox cubemap regeneration on change or interval), the one functional commit the renderer was behind. That commit is inert here — the renderer wires only AvatarOutline and ObjectHighlight and never references SkyboxEnvironmentProbe.

2. GeoffNoise.hlsl parses its C# branch at asset import

Assets/DCL/Landscape/Shaders/GeoffNoise.hlsl:(14): Error: Shader syntax error. Expected '{' but found '.'.

GeoffNoise.hlsl is a dual-target source — HLSL for the mountain shaders, C# for a CPU mirror — and selected its branch with #if SHADER_TARGET. That macro only exists while a shader is actually being compiled. Unity 6.5 parses .hlsl files during asset import, where no shader macros are defined, so the preprocessor fell through to the C# branch and the parser hit line 14:

namespace Decentraland.Terrain

namespace is an HLSL keyword, so the parser wanted { and found the dot of the qualified name.

The fix keys off CSHARP_7_3_OR_NEWER, which Unity defines for every C# compilation and never in HLSL, so the branch resolves identically with or without shader context. All five guards are inverted to match.

Test Instructions

Steps (standard run):

metaforge explorer run XXXX  # ← replace with this PR number

Expected result: terrain and mountains render as on dev — no flat, black, or missing mountain geometry. The console shows no GeoffNoise.hlsl shader syntax error.

Steps (Avatar Preview Renderer): open the Preview URL from the Avatar Preview Renderer — Vercel Preview is ready! comment on this PR.

Expected result: the avatar renders toon-shaded (not magenta) with correct outlines — the outline and highlight features come from the repointed package.

Prerequisites

  • Open Explorer/ in Unity 6000.5.9f1 at least once — the shader fix is an import-time error, so it only shows on a project open / reimport, not in a built player
  • For the Avatar Preview Renderer, use the Preview link posted on this PR in a WebGPU-capable browser

Test Steps

  1. Open Explorer/ in the editor. Console has no GeoffNoise.hlsl error.
  2. Right-click Assets/DCL/Landscape/Shaders/GeoffNoise.hlslReimport. Still no error.
  3. Enter a Genesis City parcel with visible mountains. Terrain height, normals, and mountain silhouettes match dev.
  4. Open the Avatar Preview Renderer preview URL. Avatar is toon-shaded, outlines correct.
  5. ?mode=configurator&username=test — the configurator renderer also loads (it wires both features).

Additional Testing Notes

Verification actually performed — please read before approving:

  • Neither change was run through a Unity editor by me. The shader fix is verified at the preprocessor level: evaluating the file's directives shows the original with no macros defined does select the C# branch (reproducing the reported error), the patched file selects the HLSL branch, and the patched file's import-time output is byte-identical to the original's output under SHADER_TARGET=50. So shader compilation cannot change — but "the import error is gone in the editor" is inferred, not observed. Step 1 above is the check that matters.
  • The renderfeatures repoint is a content change, not just a cosmetic repin. 1691b33d alters SkyboxToCubemapRendererFeature.cs (+20/-10). I confirmed the renderer's two URP renderer assets reference only AvatarOutline and ObjectHighlight, and that SkyboxEnvironmentProbe appears nowhere in avatar-preview-renderer/, so the change should be inert — but the renderer's Web output is built by CI, not locally, so the Preview is the first real exercise.
  • The C# half of GeoffNoise.hlsl is dead: there is no .cs counterpart, nothing compiles the file as C#, and nothing references GeoffNoise from C#. This PR preserves it rather than deleting it, since removing ~120 lines of someone's intended CPU/GPU parity source is a separate decision. Worth a follow-up.

Quality Checklist

  • Changes have been tested locally
  • Documentation has been updated (if required) — n/a
  • Performance impact has been considered — none; shader output is byte-identical and the package change is inert
  • For SDK features: Test scene is included — n/a

mikhail-dcl and others added 2 commits September 3, 2026 11:43
…unity-6-5 branch

The Unity 6.5 upgrade pinned decentraland.renderfeatures to
`#chore/unity-6-5` in avatar-preview-renderer so it could pick up the
6.5 fixes before they landed. That branch was merged as
unity-explorer-packages#62 and deleted, but the pin was never moved back
to `main` the way Explorer's was.

Resolution still works today only because the locked hash
(4426b066) is an ancestor of main, so UPM checks it out by SHA -- the
renderer build on dev at 7870599 succeeded 80 minutes after the branch
was deleted. It breaks the moment packages-lock.json is regenerated or
dropped, because UPM then has to resolve the branch ref and gets a 404.

Drop the pin and relock onto 04b022e9, which is what Explorer's lock
already carries, so both projects consume byte-identical RenderFeatures.

This also picks up unity-explorer-packages 1691b33d (gate skybox cubemap
regeneration on change or interval), the one functional commit the
renderer was behind on. It is inert here: the renderer wires only
AvatarOutline and ObjectHighlight, and never references
SkyboxEnvironmentProbe.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…mport

GeoffNoise.hlsl is a dual-target source: HLSL for the mountain shaders,
C# for a CPU mirror. It picked the branch with `#if SHADER_TARGET`, which
only holds while a shader is actually being compiled. Unity 6.5 parses
`.hlsl` files during asset import, where no shader macros are defined, so
the preprocessor fell through to the C# branch and the parser died on
line 14:

  Assets/DCL/Landscape/Shaders/GeoffNoise.hlsl:(14): Error: Shader syntax
  error. Expected '{' but found '.'.

`namespace Decentraland.Terrain` -- `namespace` is an HLSL keyword, so the
parser wanted a brace and found the dot of the qualified name.

Key off CSHARP_7_3_OR_NEWER instead, which Unity defines for every C#
compilation and never in HLSL, so the branch resolves the same way with or
without shader context. All five guards are inverted to match.

Verified by evaluating the file's directives directly: the original with no
macros defined does select the C# branch (reproducing the error), the
patched file selects the HLSL branch, and the patched file's import-time
output is byte-identical to the original's output under SHADER_TARGET=50 --
so shader compilation is unchanged. The C# branch is also still selected
when C# symbols are defined.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mikhail-dcl
mikhail-dcl requested review from a team as code owners September 3, 2026 08:49
@github-actions
github-actions Bot requested a review from DafGreco September 3, 2026 08:49
@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🚦 CI Status

Build

Windows and Mac built successfully in Unity Cloud.

Name Links & timing
Build 534b2f8 · Logs · built 2026-09-03T10:27:01Z
Windows GitHub job · Unity Cloud #1 · Unity log · ⏱ 59m 30s build + 6m 4s queue · Download .zip · .zip via S3
Mac GitHub job · Unity Cloud #1 · Unity log · ⏱ 1h 27m build + 5m 2s queue · Download .zip · .zip via S3

Lint

Lint did not finish (failure) — the warning ratchet could not be evaluated. See logs.

Tests

⚠️ EditMode produced no results — the run likely crashed or timed out before finishing. Check the Unity Test / Test (editmode) job.

TESTS SUITE Result Passed Failed Skipped Tests time Job time
EditMode ⚠️ No results 34m 31s
PlayMode ✅ Passed 248 0 37 42s 13m 57s

Tests time sums the test cases; Job time is the job's wall clock including checkout, licensing and asset import.

Slowest tests
  • [playmode] 4.8s Global.Tests.PlayMode.CubeWaveSceneShould.EmitECSComponents
  • [playmode] 2.9s DCL.SDKComponents.Tween.Tests.TweenUpdaterSystemShould.ContinuousTweensRunIndefinitelyWhenDurationIsZero
  • [playmode] 2.7s DCL.AvatarRendering.AvatarShape.Tests.AvatarBaseLegacyAnimationPlayModeShould.ReplaceEmoteAnimation_DoesNotEnableAnimator_WhileLegacyAnimationIsPlaying
  • [playmode] 2.1s DCL.SDKComponents.Tween.Tests.TweenUpdaterSystemShould.RotateContinuousCompletesAfterDuration
  • [playmode] 2.1s DCL.SDKComponents.Tween.Tests.TweenUpdaterSystemShould.MoveContinuousMovesAndCompletesAfterDuration
  • [playmode] 2.1s DCL.SDKComponents.Tween.Tests.TweenSequenceSystemShould.TweenSequenceWithoutLoopCompletesOnce
  • [playmode] 2.1s DCL.SDKComponents.Tween.Tests.TweenUpdaterSystemShould.TextureMoveContinuousOffsetCompletesAndUpdatesMaterial
  • [playmode] 2.0s DCL.SDKComponents.Tween.Tests.TweenSequenceSystemShould.TextureMoveSequenceUpdatesMaterial
  • [playmode] 1.5s DCL.SDKComponents.Tween.Tests.TweenSequenceSystemShould.TweenSequenceWithMoveRotateScaleWithOmittedScale_ResolvesScaleFromCurrentTransform
  • [playmode] 1.5s DCL.SDKComponents.Tween.Tests.TweenUpdaterSystemShould.RotateContinuousPositiveAndNegativeYDirectionsAreOpposite

Full report: run summary · results + editor logs: editmode · playmode

Performance

🏁 Bare-metal benchmark finished — run #33744406450.

Full report

PR #9956, run #33744406450

Overall: ✅ no significant changes

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

How to read this table
  • Each build is measured 3 times, interleaved with the other build (change, baseline, change, baseline, ...) in the same session, so both see the same world content and machine state. The values are the median, and (min–max) is the lowest and highest of those runs.
  • Δ is Change minus Baseline (a negative Δ means Change is faster).
  • 🟢 faster / 🔴 slower — a difference that passed every check: the runs are fully separated (every run of one build faster than every run of the other), and the median difference is at least 3% and at least 0.5 ms.
  • ⚪ within noise — the builds' runs overlap, or the difference is tiny; it cannot be told apart from random variation. Treat it as no change.
  • — informational — the 0.1% worst metrics average only the few worst frames of a run, so a single OS hiccup swings them by a lot; they are shown for context and never earn a verdict.
  • ⚠️ no verdict — the two builds' sessions were not comparable (very different sample counts, or too few usable runs), so no conclusion is drawn from them.
  • Exceptions per run — the average number of exceptions in a run's log, not counting teardown ones logged while the app quits. Flagged only on a difference of at least 2 per run and 1.5× the other build; exception kinds the baseline never threw are called out under the table. The Exception breakdown groups all of them by the explorer's report category and exception type (as totals across the runs).
  • A run that logged unusually many exceptions (at least 10 and 5× the median of its build's runs — e.g. a service was down during it) is excluded from all numbers and called out under the table.
  • The Overall line at the top only reacts to a metric that moved on two or more machines, or by 10% or more on one — a single modest 🟢/🔴 cell can still be a statistical fluke.

Apple M1

Metric Baseline Change Δ Result
Samples 3846 (×3) 3584 (×3)
CPU average 23.2 ms (22.6–23.8) 24.9 ms (22.3–25.6) 1.7 ms ⚪ within noise
CPU 1% worst 220.6 ms (215.9–221.3) 221.2 ms (37.1–223.4) 0.6 ms ⚪ within noise
CPU 0.1% worst 231.3 ms (225.0–233.7) 227.4 ms (83.9–263.2) -3.9 ms — informational
GPU average 41.2 ms (40.6–41.4) 41.6 ms (41.0–42.2) 0.5 ms ⚪ within noise
GPU 1% worst 49.2 ms (48.5–51.5) 53.5 ms (49.9–54.7) 4.3 ms ⚪ within noise
GPU 0.1% worst 51.3 ms (50.4–54.4) 55.5 ms (53.4–56.7) 4.3 ms — informational
Exceptions per run 0 0 0 ⚪ no significant change

Intel Core i5

Metric Baseline Change Δ Result
Samples 4127 (×3) 4420 (×3)
CPU average 21.7 ms (18.5–22.1) 20.2 ms (14.1–21.6) -1.5 ms ⚪ within noise
CPU 1% worst 408.7 ms (299.7–448.3) 370.1 ms (51.1–412.3) -38.7 ms ⚪ within noise
CPU 0.1% worst 447.5 ms (406.9–488.6) 406.7 ms (236.9–435.4) -40.8 ms — informational
GPU average 13.9 ms (12.2–14.4) 13.0 ms (8.5–13.7) -0.9 ms ⚪ within noise
GPU 1% worst 253.0 ms (216.9–253.2) 215.2 ms (19.3–260.1) -37.8 ms ⚪ within noise
GPU 0.1% worst 447.3 ms (407.7–482.5) 406.8 ms (31.6–429.5) -40.5 ms — informational
Exceptions per run 0 0 0 ⚪ no significant change

Automation

On demand — comment /visual-tests on this PR to run the visual regression suite against its build.

@decentraland-bot
decentraland-bot self-requested a review September 3, 2026 08:50

@decentraland-bot decentraland-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review — PR #9956

STEP 2 — Root-cause check ✅

This PR fixes two distinct root causes left over from the Unity 6.5 upgrade (#9871):

  1. Stale branch pinavatar-preview-renderer/Packages/manifest.json referenced #chore/unity-6-5, which was merged and auto-deleted. The current resolution works only by coincidence (UPM resolves the locked SHA from packages-lock.json); it will break the moment the lock file is regenerated. The fix correctly drops the branch fragment so UPM resolves against main, and relocks onto 04b022e9byte-identical to Explorer's lock entry.

  2. Incorrect preprocessor guardGeoffNoise.hlsl used #if SHADER_TARGET to distinguish HLSL from C#. That macro is only defined during actual shader compilation; Unity 6.5 now syntax-checks .hlsl files at asset import with no shader macros active, so the preprocessor fell through to the C# branch and hit namespace Decentraland.Terrain — a syntax error in HLSL. Replacing all five guards with #if !CSHARP_7_3_OR_NEWER / #if CSHARP_7_3_OR_NEWER is correct: CSHARP_7_3_OR_NEWER is defined for every C# compilation and never in HLSL or at import time.

Both changes address the cause, not a symptom.

STEP 3 — Design & integration ✅

No new units, systems, managers, or persistent state introduced. No lifecycle changes. The shader file is not a class — it is a dual-target source file with preprocessor branching. The package repin is a JSON config change. Design review is not applicable.

STEP 4 — Member audit ✅

No public properties or members added or changed. Not applicable.

STEP 5 — Line-level review ✅

Preprocessor logic verification — all five guard sites checked:

Location Old guard New guard Semantics preserved?
Line 7 (HLSL macros) #if SHADER_TARGET #if !CSHARP_7_3_OR_NEWER ✅ HLSL path when not in C#
Line 626 (rotation matrices) #if SHADER_TARGET #if !CSHARP_7_3_OR_NEWER ✅ Static const arrays for HLSL
Line 696 (SampleBilinearClamp) #if !SHADER_TARGET #if CSHARP_7_3_OR_NEWER ✅ C#-only method
Line 713 (GetOccupancy) #if !SHADER_TARGET #if CSHARP_7_3_OR_NEWER ✅ C#-only method
Line 791 (namespace close) #if !SHADER_TARGET #if CSHARP_7_3_OR_NEWER ✅ Close C# namespace/class

All inversions are consistent: SHADER_TARGET (defined in shader compilation) → !CSHARP_7_3_OR_NEWER (not defined in shader/import = same path). The three negated guards (!SHADER_TARGETCSHARP_7_3_OR_NEWER) are similarly correct.

Package repin verification:

  • Explorer's manifest.json (on dev): "decentraland.renderfeatures": "git@github.com:decentraland/unity-explorer-packages.git?path=/RenderGraphs/RenderFeatures" — no branch pin ✅
  • Explorer's packages-lock.json (on dev): hash 04b022e939c25c339fbdec5a30e11b2d3e851237
  • PR's avatar-preview-renderer lock: same hash 04b022e9... ✅ — both projects now consume the same RenderFeatures commit.

The new commit picks up 1691b33d (SkyboxToCubemapRendererFeature.cs), which is confirmed inert for the renderer — SkyboxEnvironmentProbe appears nowhere in avatar-preview-renderer/.

No issues found (P0, P1, or P2).

Security review ✅

  • No secrets, credentials, or tokens in the diff
  • Package reference stays on the same Decentraland-owned repository (decentraland/unity-explorer-packages), moving from a deleted branch to the default (main) — reduces supply chain risk
  • Preprocessor symbols (CSHARP_7_3_OR_NEWER) are compiler-defined, not user-influenceable
  • No injection vectors

Consumer impact ✅

No public API surface changes. The shader output is byte-identical under compilation. The package repin affects only the avatar-preview-renderer project's internal dependency resolution.

STEP 6–9 — Verdict

REVIEW_RESULT: PASS ✅
COMPLEXITY: SIMPLE
COMPLEXITY_REASON: Preprocessor guard swap in a shader file and a JSON package repin — no runtime logic, ECS, async, or architectural changes.
QA_REQUIRED: YES


Reviewed by Jarvis 🤖 · Requested by decentraland-bot via GitHub

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Auto-approved based on Jarvis review — simple fix/chore with no blocking issues. QA approval is still required.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

badge

Avatar Preview Renderer — Vercel Preview is ready!

Field Value
Preview https://unity-explorer-gu20i0e43-decentraland1.vercel.app
Commit 534b2f8d84a22ac0bdca3c2fae9764adb56cce5b
Logs https://github.com/decentraland/unity-explorer/actions/runs/33735480809

@mikhail-dcl
mikhail-dcl merged commit 1d87826 into dev Sep 4, 2026
29 of 39 checks passed
@mikhail-dcl
mikhail-dcl deleted the fix/renderer-renderfeatures-repin branch September 4, 2026 11:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants