Minimal Swift packages reproducing toolchain and compiler bugs encountered while developing the Swift Institute ecosystem — public receipts for issues filed at swiftlang/swift and related repositories.
Each swift-issue-*/ subdirectory holds one minimum reproducer of a
single Swift toolchain or compiler bug. Reproducers are reduced to the
minimum trigger: no package-internal types, no transitive dependencies,
no special swiftSettings beyond what the bug requires.
When a bug catalog entry says "this code miscompiles on Linux release,"
the issue reproducer proves it — runnable from swift test (or directly
via the standalone executable) and verified by CI on every supported
platform.
The companion research repository is at swift-institute/Research. The companion experiments repository is at swift-institute/Experiments.
Every swift-issue-*/ subdirectory follows this steady-state layout.
The convention was established by
swift-issue-pointer-arithmetic-linux-miscompile/ and applies to every
subsequent issue.
swift-issue-<topic>/
├── README.md — bug summary, trigger characterization, workaround
├── INVESTIGATION-ARC.md — (optional) multi-round convergence record
├── ISSUE-<NNNN>-COMMENT.md — (optional) staged upstream-posting draft
├── Tests/
│ └── Reproducer.swift — Swift Testing harness, withKnownIssue flip semantics
├── Sources/
│ └── Reproducer/
│ └── main.swift — standalone exit-code reproducer
└── evidence/ — (optional) bisection artifacts from investigation
├── README.md
└── …
Each issue declares exactly two SwiftPM targets in the root
Package.swift:
.testTarget(
name: "swift-issue-<topic>-Tests",
path: "swift-issue-<topic>/Tests"
),
.executableTarget(
name: "swift-issue-<topic>-Repro",
path: "swift-issue-<topic>/Sources/Reproducer"
),Target names match the issue directory so swift test --filter <issue-dir-underscored> selects exactly this issue's tests via substring
match on the module-name prefix (SwiftPM converts hyphenated target
names to underscored module identifiers).
Tests/Reproducer.swift— Swift Testing. Wraps the bug's minimum trigger inwithKnownIssue("swiftlang/swift#NNNN", when: { <platform-precondition> }). Green while the bug fires on the configured platforms (current toolchain state); flips red the moment the upstream fix lands and the bug stops firing. The red flip IS the fix-detection signal — captured by the weekly nightly CI cron.Sources/Reproducer/main.swift— standalone executable.exit(0)on no-bug-fired,exit(1)on bug-fired. Covers codegen surfaces that the SwiftPM test runner may mask on some toolchains. Useful for ad-hoc probing against a specific toolchain image (e.g.,docker run --rm swift:6.3 swift run swift-issue-<topic>-Repro).
.disabled(if: …) is silent when upstream lands a fix — no
signal, no PR-trigger, no detection. withKnownIssue flips red the
moment the bug stops firing on the configured platform, which IS the
upstream-fix detection mechanism. Skipping via .disabled alone is a
regression of detection capability and is forbidden per the per-issue
convention.
- Create
swift-issue-<topic>/at the repo root. - Write the bug
README.md+ (optional)INVESTIGATION-ARC.md. - Author
Tests/Reproducer.swiftandSources/Reproducer/main.swift. - Add the two targets to the root
Package.swift. - Push. CI auto-includes the new issue via
enumerate-issues'sls -d swift-issue-*/— zero CI maintenance.
Each issue is a target in this repo's root Package.swift. Clone and
test from the repo root:
git clone https://github.com/swift-institute/Issues.git
cd Issues
swift test # all issues
swift test --filter swift_issue_<topic> # one issue
swift run swift-issue-<topic>-Repro # standalone executableRequires Swift 6.3 or newer.
Continuous integration is per-issue × per-platform.
- A single
enumerate-issuesjob emits theswift-issue-*/directory list as a JSON array. - A
per-issuematrix job consumes that list and calls the centralizedswift-institute/.githubreusable workflow once per issue withtest-filter: <issue-dir>— one full reusable invocation (macOS / Linux release / Linux nightly / Windows + format + lint + advisory linters) per issue. Each(issue × reusable-job)leg is its own status check. fail-fast: false— one issue's red leg never cancels sibling issues' legs.- Weekly cron at Monday 06:00 UTC re-runs the matrix. The reusable's
linux-nightlyleg (swiftlang/swift:nightly-main-jammy) is wherewithKnownIssueflips red on upstream-fix-landing. - No
ci-okaggregator-gating. The Issues repo's branch protection doesn't referenceci-ok; per-issue test legs are the actionable signals; one red issue does not block merges.
For an issue reproducer, a permanently-red Linux release leg is the
bug's running evidence. When the upstream fix lands and the
withKnownIssue block stops firing on nightly-main-jammy, that's the
signal to close the issue and either remove the reproducer or relocate
it as a regression fixture.
Each issue subdirectory documents its bug in README.md. Current
issues:
swift-issue-pointer-arithmetic-linux-miscompile/— Pointer-arithmetic release-mode miscompile (swiftlang/swift#77558), fixed on 6.4-dev nightly-main.swift-issue-tagged-noncopyable-atomic-metadata-crash/—Atomic<Tagged<Tag, Ordinal>>.advance(within:)runtime metadata SIGSEGV on Apple Swift 6.3.x; demangling-time conformance lookup fails for cross-module conditionalAtomicRepresentableconformance with~CopyableTag suppression. Fixed on Swift 6.4-dev nightly2026-03-16-aand later. Upstream filing pending.