Ditch Swift differentiation implementation #45
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Compiling the project with a snapshot version of a Swift 6 toolchain has not been an experience I would blatantly call "delightful".
Sudden
SourceKitServicecrashesThe
_Differentiationmodule also seems unready for non-experimental usage, seen that even trivialities like extending one of its types (e.g., making a type differentiable) may (or may not!) crashSourceKitService. As explained in #40, which introduces fields into Deus and, therefore, requires differentiation:https://github.com/project-deus/Deus/blob/59455693eb99556ff3b5eb8200e481339962b972/QuantumMechanics/Field/Space.swift#L34-L38
Possible SPM–toolchain incompatibility
On top of that, there seems to be an issue with SPM on such a version of the Swift toolchain: setting it as that with which
xcbuildbuilds and tests the project errors with:(Which is rather funny: why is
fatalErrorbeing output? Why is the warning being run as a shell command? 🥸)(See #44 and https://github.com/project-deus/Deus/actions/runs/17702698250/job/50310350535.)
Because of these issues, which are halting advancements on the project, insisting on using differentiation implemented by Swift has proven to not be a good idea. The solution appears to be to do so manually.