You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This tracks a bunch of miscellaneous tasks that I accumulated while working on Silk 3.
I'm open for anyone to work on these tasks, but please discuss with me in the Silk Discord first.
In-progress
Tasks in progress will be moved to the corresponding pull request.
Uncategorized
This section contains informal reports, suggestions, or complaints about Silk 3.
I'm logging them here so they don't get forgotten about until I either open a formal issue or address them.
From Aqua:
libSDL3.so is humongous (should not be nearly 14 MB)
Exanite: I checked my system version and that one is only 3 MB.
Silk 3 does not prefer its own native binaries? I.e., it prefers the system ones instead of the ones shipped by Silk.
I need to also check with Curin to see how much RAM their device has. If their device doesn't have enough RAM, this might explain why the Microsoft job takes so long (aside from it already processing a lot of data).
Run the Microsoft job locally and see how much RAM it takes on my device.
Investigate whether direct P/Invoke and static linking works in Silk 3 and how we want to support it.
See: I'm not familiar with what direct P/Invoke means though
Specifically, it involves some configuration, providing static builds, and maybe switching over to LibraryImport over DllImport.
High priority
Generator:
ExtractEnumConstants does not preserve attributes placed on extracted constants (needs verification).
Bindings usage:
Why don't we use the InlineArrayN<T> types provided by .NET? Should we use them?
Someone in the C# discord mentioned that these were added in .NET 10, which is what led to me add this task. This might be the reason we don't use them?
OpenAL context should be disposable
This is noted by Perksey in the OpenAL.Tutorial001.HelloSound project. I need to figure out what this Dispose method should do exactly.
Check other API contexts as well for the same issue
channels/521092042781229087/1514735149915439274/1519099432442794150
The magic nullptr constant does not work. It fails to resolve to anything.
Apparently it works in the Silk 3 examples. Probably because it uses a ProjectReference instead of a PackageReference.
I'm going to implement a temporary hack fix, but I don't believe it to be the correct fix.
We need a way to initialize an assembly consistently.
Currently there are multiple entrypoints and they aren't guaranteed to be called.
In Vulkan, we call RegisterHook in both Vk (defined in a manual file) and Vk.DllImport (defined in a generated file).
This causes a multiple registration error, which admittedly is my fault since I didn't realize OpenAL didn't do the same pattern.
Removing the duplicate call in Vk is the "fix" I mentioned above, but does not solve the underlying issue.
Static constructors are only invoked if the static constructor's type or members are accessed.
Notably, accessing Vk.DllImport does not trigger the static constructor for Vk, and vice versa.
Because we assume/require both static constructors to be called for proper behavior (Vk.DllImport registers the hook and is not extensible, so we have to register alternative shared library names in Vk), having only one of them be called is a problem.
Add option to configure which vendor suffixes KhronosNonExclusiveVendor can identify. Eg: For OpenGL, this should be only ARB.
Consider making function pointer structs work with nullptr. Seems like a nice QOL feature.
OpenXR/CL/Vulkan: Add CurrentInstance/Device/Platform properties to interface partial.
Enums and other integral typedefs:
These have been proving to be consistently annoying to work with...
Vulkan and OpenXR have some special handling so this problem is less problematic, but still exists.
I don't think the OpenGL bindings specify the method parameter types properly
Vulkan: Some types are incorrect. uint is used instead of MaybeBool<uint>. https://discord.com/
OpenCL: Same issue. Tracked in the smoke test project as todos.
Documentation:
Add Vulkan smoke test project
Differentiate between smoke tests and actual tutorials/examples. I would categorize the current SDL/OpenAL "tutorials" in Silk 3 to be smoke tests since they really shouldn't be referenced as sources of best practices.
Maintenance:
Consider removing ModCSharpSyntaxRewriter
Add SilkConstants class to generator
Ideally all magic numbers and constants are consolidated here and documented.
DI:
Fix issues when running multiple jobs
Figure out why the headers are getting mixed up when running multiple jobs at the same time.
Seems to be related to TransformFunctions.
Figure out why the SDL handle structs are getting named as Silk.NET.SDL.ConditionHandle.gen.cs instead of ConditionHandle.gen.cs when running multiple jobs at the same time.
Maybe rework how using statements are added. Not sure why, but using statements are randomly added/removed between Windows/Linux. This causes noisy diffs.
Investigate how DI is set up in this project. I believe it is the core cause of the multi-job isolation issues. I need to verify this, but the jobs seem to share the same mod instances instead of being separated. This would explain why we need to access data by job key instead of it being simply injected into the mod instances.
Rework registration/configuration system to be in pure C# instead of JSON
Add some way of verifying our bindings are well polished.
These would mainly involve simple automated sanity checks that ensure our bindings our consistent. Could be done as a separate CLI project from SilkTouch.
Check for spelling/casing issues? Identifiers like Sdl.PropGpuDeviceCreateDebugmodeBoolean are technically correct (native name is SDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN, so Debugmode is "one" word), but we could have an audit tool that checks for these non-ideal cases so we can add manual overrides. Worth the effort? Probably not unless we care about perfecting the bindings.
Maintenance:
ClangSharp switched from System.CommandLine to a custom command line argument parser. I noticed that we had verbatim copied code from ClangSharp for handling arguments in Silk 3, so we should update that.
This also lets us update System.CommandLine, which if I recall, we are still using a beta version of.
Low priority
CI:
Prevent native builds from triggering unnecessarily when the PR description is edited
Native builds should only trigger once. If the last commit in the PR is from the native builds workflow, it should not run again.
Figure out how to make our CI workflows work with forks.
Switch to SLNX solution format to improve readability/mergability
From Ethereal: They had a CSharpier TypeLoadException when running the Win32 job on develop/3.0. Might be related to the error I saw half a year ago. If so, likely can be fixed by simply updating CSharpier. CSharpier has updated their Roslyn package since then.
The summary is that the current set of 2 regexes doesn't elegantly handle the case where the ending of a word should not be trimmed, but the word itself can have data type suffixes.
For example: alSourceRewindv and alSourceRewind. The d in Rewind can be mistaken as a data type suffix, so we add it to the EndingsNotToTrim regex. However, the dv in Rewindv also has the same problem.
We likely need something more akin to WordsNotToTrimInto than EndingsNotToTrim.
Investigate why we currently use DllImport in Silk 3.
Also added some light documentation to AddVTables in the mod MD docs.
Eg: BitCasting a user struct to a Vector struct and immediately using an SIMD operation is now properly optimized. Free performance!
This mainly affects Otac0n's work, but I'm logging it here so I also keep it in mind as I work on the bindings.
Decision: Just going to keep this in mind. Don't think I need to actively review the bindings for this since there's not many places where this will be used.
Not doing
For transparency and for reference, I'll move any tasks I don't plan on doing here.
Figure out how to handle CLA properly. Currently native builds will block CLA due to the use of a bot account.
Exanite's Tracking Issue
This tracks a bunch of miscellaneous tasks that I accumulated while working on Silk 3.
I'm open for anyone to work on these tasks, but please discuss with me in the Silk Discord first.
In-progress
Tasks in progress will be moved to the corresponding pull request.
Uncategorized
This section contains informal reports, suggestions, or complaints about Silk 3.
I'm logging them here so they don't get forgotten about until I either open a formal issue or address them.
From Aqua:
From Ethereal:
From Nolram (https://discord.com/channels/521092042781229087/607634593201520651/1524213012402147348):
High priority
Generator:
ExtractEnumConstantsdoes not preserve attributes placed on extracted constants (needs verification).Bindings usage:
InlineArrayN<T>types provided by .NET? Should we use them?channels/521092042781229087/1514735149915439274/1519099432442794150
nullptrconstant does not work. It fails to resolve to anything.RegisterHookin both Vk (defined in a manual file) and Vk.DllImport (defined in a generated file).KhronosNonExclusiveVendorcan identify. Eg: For OpenGL, this should be onlyARB.nullptr. Seems like a nice QOL feature.Enums and other integral typedefs:
These have been proving to be consistently annoying to work with...
Vulkan and OpenXR have some special handling so this problem is less problematic, but still exists.
void DrawElements(uint mode, uint count, uint type, void* indices);uint.uintis used instead ofMaybeBool<uint>. https://discord.com/Documentation:
Maintenance:
ModCSharpSyntaxRewriterDI:
TransformFunctions.Silk.NET.SDL.ConditionHandle.gen.csinstead ofConditionHandle.gen.cswhen running multiple jobs at the same time.Medium priority
Bindings:
CLongwhere possible in the bindings.Constant<CLong, EnumHere>, and theoretically it should work.IsProbablyABitmaskfunction based on BuildTool's IsProbablyABitmask for identifying flags enumsQuality:
Sdl.PropGpuDeviceCreateDebugmodeBooleanare technically correct (native name isSDL_PROP_GPU_DEVICE_CREATE_DEBUGMODE_BOOLEAN, soDebugmodeis "one" word), but we could have an audit tool that checks for these non-ideal cases so we can add manual overrides. Worth the effort? Probably not unless we care about perfecting the bindings.Maintenance:
Low priority
CI:
Maintenance:
High level utilities:
IDE / Metadata:
NativeNamefor resolving API profilesNativeNameattributes.StripAttributestoCleanupAttributesand adding an option in its config to optimizeNativeNameattributes.Completed
Completed during #2588:
develop/3.0. Might be related to the error I saw half a year ago. If so, likely can be fixed by simply updating CSharpier. CSharpier has updated their Roslyn package since then.Completed during #2591:
--onlyoption from Curin's branch so I don't need to specify--skipfor all but one jobCompleted or planned to be completed during #2590 (not yet merged):
.gen.cs.csfiles during theGenerated Bindings OutputsectionalSourceRewindvandalSourceRewind. ThedinRewindcan be mistaken as a data type suffix, so we add it to theEndingsNotToTrimregex. However, thedvinRewindvalso has the same problem.WordsNotToTrimIntothanEndingsNotToTrim.AddVTablesin the mod MD docs.Completed in dotnet/ClangSharp#699
SDL_MAX_SINT64generation on Linuxpublic const nint SDL_MAX_SINT64 = unchecked(0x7FFFFFFFFFFFFFFF);does not compileCompleted outside of a PR:
DrawElements/etc, check if the pointer to 0 issue present in Silk 2 still exists in Silk 3Not doing
For transparency and for reference, I'll move any tasks I don't plan on doing here.
Figure out how to handle CLA properly. Currently native builds will block CLA due to the use of a bot account.