stride3d / stride3d/stride

[Asset] List mixing refs and inline values can fail to deserialize properly

Open
#1,882 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Release Type: Any

Version: Latest as of writing

Describe the bug
Works as expected when loading up the project, on the next reload of the source it will fail during yaml serialization.

To Reproduce
Steps to reproduce the behavior:

  1. Use the following snippet
public class TestRenderer : SceneRendererBase
{
    protected override void DrawCore(RenderContext context, RenderDrawContext drawContext){}
}
  1. Add this new renderer to the graphics compositor.
    image
  2. Save the project.
  3. Make any change to your source.
  4. Notice the gamestudio failing to reload the assembly.

When the assembly is reloaded, for some godforsaken reason, the serializer fetches the ID of the DebugRenderer and attempts to cast TestRenderer to IIdentifiable, see stacktrace.

Log and callstacks
Stacktrace after making any change in the source while the gamestudio is open.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the TestRenderer reproducer in the issue and inspect the linked stack trace. Trace YAML serialization during the GameStudio assembly reload, focusing on the attempt to fetch DebugRenderer's ID and cast TestRenderer to IIdentifiable. Done means the project reloads successfully after a source change when a list mixes references and inline values.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.