Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP POC: Object Descriptor in Roslyn #2056

Draft
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

IXLLEGACYIXL
Copy link
Collaborator

PR Details

Instead of scanning with reflection in runtime multiple times, get the info through roslyn.
Should be used to unify Yaml, Object Descriptor and Assembly Processor towards Roslyn

Description

Related Issue

Motivation and Context

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

@Eideren Eideren marked this pull request as draft November 21, 2023 23:07
@archanox
Copy link

archanox commented Dec 5, 2023

I came here from the now deleted CoreAoT issue. I'm curious if there is a short list of where we are using reflection where we can supercede it with Source Generators?

@IXLLEGACYIXL
Copy link
Collaborator Author

IXLLEGACYIXL commented Dec 5, 2023

I came here from the now deleted CoreAoT issue. I'm curious if there is a short list of where we are using reflection where we can supercede it with Source Generators?

Reflection on its own isnt that big of a problem as it works with AOT too, it just works differently

the big problems that i know
#1609 => assemblyprocessor has to die and this is the roslyn approach
to kill the assemblyprocessor there needs to be a unified way to detect the fields which have to be serialized
as there are 3 serializers using almost the same rules for serialization and to start with assemblyprocessor is almost impossible

so i started with the first serializer, the objectdescriptor here ( editor serializer ) i wanted to remove the detection of what should be serialized and not the entire reflection

when this is fixed we can continue with yaml https://github.com/NexStandard/StrideSourceGenerator/tree/IncrementalApproach
and assemblyprocessor

then we have the major problems source generated

you could start with a "peace meal" conversion of the core components like Stride.Core and Stride.Core.Design to convert them to AOT , i doubt that we will ever reach that with trimming

probably stride.core.mathematics is a good place to start to convert to AOT which wouldnt require roslyn

i dont know much about other areas like shaders and so forth, it would be good to have atleast some of the components AOT compiled, there should be something to allow a mix of aot and non aot but idk

For now i cant continue developing this,as compilerservices is bugged currently, my code has a bug with partial classes, then it should almost work there are some logic flaws in how the objectdescriptor works so i need to add a empty descriptor for the nonsense classes

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.

None yet

2 participants