Skip to content

sort Default Implementations section contents when rendering #1272

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

Conversation

QuietMisdreavus
Copy link
Contributor

Bug/issue #, if applicable: rdar://156311548

Summary

If there are multiple default implementations for a protocol method (currently happening in Swift symbol graphs due a bug when such methods are overloaded), the listed methods are unordered on the final rendered page. This can result in rendered content differing between builds, even when using the same build of DocC and the same content.

This PR enforces an order by sorting symbols via their topic reference URL before rendering.

Dependencies

None

Testing

As this is a nondeterminism bug, testing can be difficult and requires repeated executions for comparison. The unit test included in this PR only erratically would pass or fail, and required repeated attempts to ensure resolution.

Checklist

Make sure you check off the following items. If they cannot be completed, provide a reason.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • [ n/a ] Updated documentation if necessary

@QuietMisdreavus
Copy link
Contributor Author

@swift-ci Please test

@QuietMisdreavus QuietMisdreavus merged commit 69f27f2 into swiftlang:main Aug 6, 2025
2 checks passed
@QuietMisdreavus QuietMisdreavus deleted the deterministic-default-implementations branch August 6, 2025 14:46
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.

2 participants