The Sparkles toolchain — Upstreaming plan
Abstract
Sparkles builds with its own branches of DMD, LDC, LLVM, Phobos and the dlang.nix packages, because the programs it ships need compiler fixes and capabilities that no upstream release has. This plan lists every change those branches carry: what each change is, the commits that carry it, the requirement that needs it, where it stands upstream, and the order in which it can be proposed. Each entry ends merged upstream, superseded by an upstream fix, or kept in the fork for a stated reason, so that the forks carry nothing they do not have to.
Introduction
A compiler fork is cheap to start and expensive to keep. Each upstream release has to be merged into it, and each change it carries makes the merge slower. A fork whose changes are not upstreamed becomes permanent, and its owner ends up carrying other people's fixes as well as their own.
Changes reach the forks from many places: the toolchain specification, its WASI page, the shader toolchain, the build graph, and the language server and formatter (dmd-lsp, dmd-fmt). Each page records why it needs its change, but none says where the change stands upstream. The DMD language-server branch kept its own plan in the fork, and that plan fell behind the branch. Without one list, a change that upstream has already fixed stays in the fork. A change that could be proposed is never proposed, and nothing shows which proposal is waiting on another.
This page is that list, and it supersedes the plan the language-server branch kept. A change gets one entry, under the fork that carries it. The entry names the fork commit, pinned to its full hash, and the requirement that needs the change. It also names the upstream target, the state there with links to issues and pull requests, and what blocks the next step. TCD2 decides when a change is proposed: after the programs that depend on it ship on the toolchain. This page decides what is proposed and in which order; until TCD2 allows it, each change is kept ready to submit.
Most entries exist because a specification needs them; an entry needed only by work no specification covers yet says so. Commits that only keep a fork building are listed too, such as support for an LLVM that upstream LDC does not build with, because the changes that need them cannot be proposed without them. Per-commit regression tests, and whether each test failed with its change reverted, are recorded once, in the fork review; this page links there rather than repeating them.
§1 states the rules an entry follows. §2 and §3 list the entries of DMD's two branches, the toolchain's and the language server's; §4 those of LDC; §5 those of LLVM and Phobos; and §6 those of dlang.nix, whose packages are upstreamed together with the commits they build. §7 gives the order of submission and the blockers across forks, and §8 the reports and pull-request texts that are ready to file.
1. The rules
TCU1: One entry per change. Every change carried by the DMD, LDC, LLVM or Phobos forks, or by dlang.nix's toolchain branch, must have exactly one entry on this page. The entry names its fork commits by full hash, the requirement that needs it (or that none does yet), its upstream target and its state (TCU3).
TCU2: Upstream form. A change that targets an upstream repository must exist as one commit on a fix/* branch of the fork, on the upstream default branch. The commit carries its regression test in the upstream test suite's own format (TC3). Where the toolchain branch (sparkles/main) carries the same change, the two commits differ only by the rebase.
TCU3: States. An entry is in exactly one of these states:
| State | Meaning |
|---|---|
fork-only | Deliberately not proposed; the entry says why |
ready | In upstream form (TCU2), not yet proposed |
needs-work | Not yet in upstream form, or missing its regression test; the entry names what is left |
reported | An upstream issue describes the problem; no pull request yet |
proposed | An upstream pull request is open |
blocked | Waits for another entry or an external change, which the entry names |
superseded | Upstream fixed the problem its own way; drop the fork commit at the next rebase |
merged | Upstream merged it; drop the fork commit at the next rebase |
TCU4: Drop on rebase. When a fork is rebased onto an upstream revision that contains a merged or superseded change, the fork commit must be dropped. The fork's regression test must be run on the result first: a superseded change can be a partial fix. The entry then leaves this page; the fork's history and the linked upstream change record it.
TCU5: Order. A change must not be proposed before the entries it depends on have been merged upstream. §7 names those dependencies.
2. DMD: sparkles/main
PetarKirov/dmd sparkles/main is DMD master with the commits of UD1–UD8, UD10 and UD12–UD14, plus two test-only commits (21663b0b95, UD8's test under -inline; d19ed4c2ec, UD5's test); UD9 exists only as its fix/* branch. sparkles/main is the shell's dmd, built by dlang.nix's dmd-sparkles. Every entry but UD11, which has no fix yet, has its single-commit fix/* branch, and every entry targets dlang/dmd.
| ID | Change | Fork commit, fix/* branch | Needed by | Upstream | State |
|---|---|---|---|---|---|
| UD1 | -lib writes deterministic member headers (no time, uid or gid) | b737e1b615, fix/deterministic-lib e290e20084 | Build graph decision D63; ci cache verify --rerun | No issue or PR | ready |
| UD2 | -ffile-prefix-map=<old>=<new> for paths in objects, debug info and coverage | bd40b72a72, fix/file-prefix-map 9cf869b651 | Build graph BGA5, D63 | No issue or PR; the same option as LDC's (UL10) | ready |
| UD3 | Write an output file in as many write() calls as it takes (files over 2 GiB) | dffd1fc4fe, fix/file-write-large 6c20eb1bc3 | Builds under -ftime-trace (hue at granularity 0) | No issue or PR; LDC carries it as UL6 | ready |
| UD4 | ImportC accepts a matching redeclaration of a tagged-type variable (Wayland protocol code) | 363521036c, fix/importc-tag-redeclaration 1529830 | sparkles:wsi on Wayland | dlang/dmd#24440 (fixes #24438) merged; it compares tag kind and identifier, the fork also qualifiers | superseded |
| UD5 | Emit a struct instance's TypeInfo members when the instance's codegen is elided | b675a6d14d, fix/typeinfo-skipped-instance-members a0920c9b9b | dub test with DMD (unittest builds against libraries link) | dlang/dmd#23731 open; dlang/dmd#23732 takes the same approach, contested; dlang/dmd#23832 merged, which the fork's base has, does not fix this case | ready |
| UD6 | ImportC's inline-use scan does not follow an alias into its function (stack overflow) | 56242d3c97, fix/importc-inline-scan-alias-cycle 012e1e7163 | ImportC builds of C headers that alias functions | No issue or PR | ready |
| UD7 | Keep a default argument's cast when the call copies it (libasync's cast(EPosix) errno()) | e0b6e795ff, fix/default-arg-cast e39e9652c2 | sparkles:event-horizon on libasync | No issue or PR | ready |
| UD8 | A scope lazy variadic array of delegates needs no closure (§2.1) | 0964acb1e0, fix/scope-lazy-variadic d8d29a0c3d | UI authoring AUT50: @nogc views with lazy children | dlang/dmd#22885 open, no PR; PR text in §8 | reported |
| UD9 | CTFE of core.simd vector operations | not on sparkles/main; fix/ctfe-vector-ops 18766b9dbd | The DMD side of UL5 (shader vector code in CTFE) | dlang/dmd#21823 open, no PR | reported |
| UD10 | Read a full expression's value before destroying its temporaries (return T(9).v, and T(9).get under -inline) | 333c76284f, fix/temporary-lvalue-dtor 311ee8e0f2 | UD8's test under -inline; any lazy argument reading a temporary | No issue or PR; issue and PR text in §8 | ready |
| UD11 | A ref return of a call's ref result through a temporary returns a stack copy | none: to report | Nothing yet | No issue yet; text in §8 | needs-work |
| UD12 | evalu8 clears a folded constant's bytes, so none of its operands' address survives (nondeterministic objects) | 43457b6d06, fix/evalu8-stale-bytes b87bf3b50f | Build graph BGS9 and D63: the CIC13 determinism check (sparkles-test-runner.o, CI run 45970839226) | No issue or PR | ready |
| UD13 | A comparison gother.d folds keeps none of its operands' address | 32e923a1ff, fix/gother-cmp-stale-bytes 8960287591 | Build graph BGS9 and D63, for -O builds (CIC13) | No issue or PR | ready |
| UD14 | pushParams and movParams read a constant stack argument from only its own bytes | e245294ceb, fix/push-const-arg-width 272e1623c8 | Build graph BGS9 and D63: a producer of stale bytes that UD12 and UD13 miss does not reach an object through a stack argument (CIC13) | No issue or PR; after UD12 and UD13 (§7) | blocked |
UD5's test, dshell/typeinfo_elided_instance.d, is reduced from sparkles:versions: a library built without -unittest, and an importer built with -unittest -allinst whose version (unittest) function emits _d_arrayliteralTX!(Interval!U3), and with it Interval!U3's TypeInfo. The fix/* commit carries it; sparkles/main adds it as d19ed4c2ec. UD4 is dropped at the next rebase once the fork's test passes with dlang/dmd#24440 alone (TCU4). The time-trace fix that LDC carries as UL7 needs no DMD entry, because dlang/dmd#24386 is merged and sparkles/main contains it.
UD12 and UD13 fix the producers of the stale bytes, UD14 the consumer that emitted them. Other backend readers take a constant at more than its width: movregconst through cdeq and loaddata (a 16-bit constant's bytes 2–3 in a MOV reg32,imm32), cdorth's and cdcmp's register-value tests (an instruction choice), and cgcs's hashing of a narrow constant's Vint (a missed common subexpression). They are not entries: no fork commit changes them (TCU1), and with UD12 and UD13 no producer is known to leave the bytes they would read; one becomes an entry, needs-work, when a fork commit starts on it or an object is seen to differ through it.
sparkles/main was rewritten on 2026-11-28 so that UD13's and UD14's commits make the same change as their fix/* commits (TCU2): UD13's test has its own import, and UD14's is compilable/push_const_arg.d; UD12's already did. The messages differ only where the base does: on sparkles/main, UD13's cites the previous commit for evalu8's half of the defect where the fix/* message names fix/evalu8-stale-bytes and says the object differed between compilations, and UD14's adds that the two previous commits already clear the bytes, so the push was mov EAX,0FFFFFFFFh push RAX. The commits it replaced stay fetchable under the fork's tags sparkles/pin-c95151e502 (the earlier UD13, which earlier dlang.nix pins build), sparkles/pin-486f89caa7 (the earlier UD14), sparkles/pin-2e27a1a786 (the earlier fix/gother-cmp-stale-bytes) and sparkles/pin-44211d0aeb (UD14 on the earlier UD13, which the fork review's suite run tested).
2.1 UD8: scope lazy variadic arrays
The spec's best practice says that scope on a lazy variadic array of delegates prevents a closure, because scope means the delegates do not escape. Upstream DMD does not: the argument is a slice of an array literal of delegate literals, which the check that clears a scope argument's closure never looks into, so it rejects a @nogc caller. UD8 makes the caller keep the frame on its stack, and closes the two holes that doing only that would open:
- Every typesafe variadic array is implicitly
scope. Thatscopecovers only the array, which the caller builds on its stack; it is marked inferred, so it is not mangled. Since dlang/dmd#14324 a declaredscopegets the same mark, so a caller cannot tell the two apart. Under-preview=dip1000, clearing the closure of every such argument therefore drops the closure of a callee that legally stores its delegates as well (a test read 21 instead of 42 from the dead frame). A declaredscopestays declared, and only it removes the closure; it is mangled, as it was before 2.101. scopeis not transitive, so a@safecallee can storexs[0]. For an array of zero-parameter delegates whosescopeis not the implicit one, escape analysis takes an element for the array's value. Storing, returning, appending (~,~=), slice-copying, or forwarding the array to a variadic parameter without a declaredscopeis an error in@safecode, and an override may not drop thescope.
What stays open, all of it outside the change: @trusted code that copies the elements is not checked (druntime's _dup, so xs.dup). A function pointer type with a scope parameter accepts a function without one, as it does for any scope parameter. Without -preview=dip1000, an escape is silently accepted, as for any scope parameter. Breaking changes for the pull request's changelog: the mangling of declared-scope typesafe variadic parameters, and the new @safe errors. The owner accepted both for upstreaming (2026-11-25). The tests are compiler/test/{runnable,compilable,fail_compilation}/test22885*.d; LDC carries the same commit as UL20, with an IR test and an ASan test.
3. DMD: dmdserver-dub
PetarKirov/dmd dmdserver-dub-v2.114.0 is rainers/dmd dmdserver, the language-server patch set on DMD v2.114.0, plus the commits below. It is the library that sparkles:dmd-lsp and sparkles:dmd-fmt will build on; they build today on its earlier state, e0be436ba4 (below). This section supersedes the fork's own PLAN-UPSTREAMING.md (last version; dmd-fmt cited c562711). That plan lists rows 1–15. It marks rows 3 and 7 done, upstream having made them unnecessary: on the v2.114.0 rebase. The pinned state e0be436ba4 still carries both, as US11 and US12. Its row 15, -ffile-prefix-map, is UD2.
The commits are named by their hash on the branch tip, then by their hash in the state Sparkles pins (e0be436ba4, tag sparkles-pin/dmdserver-dub-e0be436ba4).
| ID | Change | Commit (tip / pinned), fix/* branch | Needed by | Target | State |
|---|---|---|---|---|---|
| US1 | versions "LanguageServer" in the four library subpackages | 9b8950e7dc / bde0e8accc | dmd-lsp BLD1 | none | fork-only |
| US2 | root.aav: typed keys from asRange under version(GC) | f568c8182d / 8fea76c042 | dmd-lsp BLD1 | rainers/dmd dmdserver | needs-work |
| US3 | dub: drop astbase.d from dmd:parser | 706ea87c3d / f0d906d555 | dmd-lsp BLD1, BLD4 | none | fork-only |
| US4 | doc.d: the per-symbol ddoc machinery as a library API | cfe48eef1e / 5ab681e9d7, fix/doc-library-api 58f56a915a | dmd-lsp L14, DOC3, DOC4 | dlang/dmd (design discussion) | ready |
| US5 | parse.d: keep documented-unittest bodies outside the root module | 68b32e19c1 / ea88375142 | dmd-lsp L28, DDC15 | rainers/dmd dmdserver | needs-work |
| US6 | DMDLIB lexer: commentToken desync and missing whitespace token on U+2028/U+2029 | c4a65297d3 / 21a89a5368, fix/lexer-dmdlib-line-separators 21ea987474 | dmd-fmt S1 | dlang/dmd | ready |
| US7 | dmd:lexer links standalone (rootobject.d, astenums.d) | fe25ba39e3 / d807e7a579, fix/dub-lexer-standalone e19e617bb3 | dmd-fmt S1 | dlang/dmd | ready |
| US8 | Target.unrestrictedVectors | b519d956f9 / 37dc39aa15, fix/target-unrestricted-vectors 9c09d11f41 | dmd-lsp TGT2, L29 | dlang/dmd | ready |
| US9 | initDMD(…, vendorVersion, configureParams) | 5c18ba5ba7 / 3dc4deaa27, fix/initdmd-vendor-params 202135a190 | dmd-lsp TGT2, TGT4 | dlang/dmd | ready |
| US10 | dub: native assembler implementations and the C preprocessor out of dmd:frontend | 2cb16382bd / cd4bc435a2, fix/dub-frontend-native-impls 6e1b4f9e53 | dmd-lsp's frontend-only closure, COR7 | dlang/dmd and the fork | ready |
| US11 | expression.d: the LanguageServer typeInfoExp table, completed | pinned only: 75cc02845a | dmd-lsp BLD1 (the pin) | rainers/dmd dmdserver at v2.114.0 generates the table from ExpOpTypePairs | superseded |
| US12 | dub: glue/* out of dmd:frontend, as mainline excludes it | pinned only: 1830250968 | dmd-lsp BLD1 (the pin) | DMD v2.114.0 excludes it; the commit is empty after the rebase | superseded |
The branch's five other commits only edit the fork's PLAN-UPSTREAMING.md and leave the fork with it. The branch is the state Sparkles pins, e0be436ba4, tagged dmdserver-dub/2.113.0-beta.1+ls.5 with +ls.1–+ls.4 on its history, as dmd-lsp BLD1 requires. The tip-side hashes above are those of its rebase onto v2.114.0, kept on branch dmdserver-dub-v2.114.0 (and tag backup/dmdserver-dub-v2.114.0-rebase) until dmd-lsp moves to that frontend, whose API changes it does not yet build against.
No row has an upstream issue or pull request. US1 and US3 stay in the fork until the language-server patch set itself is upstream; US2 and US5 go to that patch set's branch. US2 and US5 have no fix/* branch yet, so they are needs-work. US11 and US12 leave the pin when dmd-lsp moves to the v2.114.0 frontend. The fork's plan also records three findings about DMD as a library, which are reports to file rather than fork changes: the lexer's output depends on hidden Id state (__EOF__, #line); Identifier.idPool is not thread-safe, so concurrent lexing crashes; and commentToken cannot be combined with doDocComment.
4. LDC: sparkles/main
PetarKirov/ldc sparkles/main is LDC master with 100 commits. The fork review lists each with its regression test and an "Upstreamable" verdict. Here they are grouped by the pull request each group would become. Commits are named by short hash within that pinned range. The fork has no fix/* branches yet, so no LDC entry is in upstream form (TCU2); that conversion is the first step of each group. Until then an entry that would otherwise be ready is needs-work, what is left being its fix/* branch.
| ID | Change | Commits | Needed by | Upstream | State |
|---|---|---|---|---|---|
| UL1 | dcompute's Vulkan target | 0f3f2daa31 (Pham Quang Ha's) | Shader toolchain SHT1, TC1 | ldc-developers/ldc#5132 open | proposed |
| UL2 | Shader stages, interfaces, resources and control flow on the Vulkan target | 34 commits on UL1, from 7f191ac13f to 290b691e45; test-only 0f593e4b6f, 82d94e5ba4, c73f807bcb, fb95498594, 3e4d55745f | SHT1 and the shader specifications | none | blocked |
| UL3 | Name the spirv-opt an optimized Vulkan compilation runs | 64e6453968 | Shader build SHP11, build graph BGG5 | none | blocked |
| UL4 | Size and alignment of odd-width vectors | a7aff0a499, 6a1ecf48e6 | SHT1 (vector types) | none; the DMD side is US8 | needs-work |
| UL5 | CTFE of core.simd vector operations | 387c291ebf, 4e7e38373c | Shader vector code | dlang/dmd#21823; upstream as UD9 | reported |
| UL6 | Write a frontend output file in as many write() calls as it takes | 4aa7f4a1a9 | Builds under -ftime-trace | upstream as UD3, reaching LDC through a frontend merge | blocked |
| UL7 | Print a template argument in use without expanding it (time traces) | 0b25dd4ad7 | Builds under -ftime-trace | dlang/dmd#24386 merged | superseded |
| UL8 | ImportC: matching tagged-type redeclarations | 929e60e167 | sparkles:wsi on Wayland | dlang/dmd#24440 merged (UD4) | superseded |
| UL9 | Precedence of an interpolated expression sequence | c1490a15c7 | WebAssembly tech debt WTD30 | none; a DMD frontend change | needs-work |
| UL10 | -ffile-prefix-map and -fmacro-prefix-map, and the paths they map | 3d8b19d533, a19fec3f58, bd9396c726, 8d5c3c8887 | TC15, TC13, build graph BGA5 | ldc-developers/ldc#5039 (-fdebug-prefix-map) merged; ldc-developers/ldc#3908 open | needs-work |
| UL11 | Dependency output: ImportC headers in -makedeps, -makedeps-absent, -makedeps-digests | ca5abb238f, 6ebdb35ffb, 10d6c6b987, 7bee3fbdeb | Build graph BGK2, BGK7, BGG5; SHP11 | none; new options need design agreement | needs-work |
| UL12 | Name the time trace after the output when no file is given | 84afab43cc | Builds under -ftime-trace | none | needs-work |
| UL13 | Compile-time real in the target's format on any host | 6f473423a2 | TCW11 | none | needs-work |
| UL14 | Building against LLVM main (24.0.0git) | da17f6c69a, 1e0ee44092, 10040e9a4c, 170d3d0b18, e329860504, d6fa02fee6, 1cd64184fe | TC2 | none; LDC does not support LLVM 24 | blocked |
| UL15 | WebAssembly exception handling and WASI | e8193632ae, a23cd6c137, f354aef01b, f3080882e0, 400504c38b, 7646322d77, 4e5ead1887, 3948ae9c99, 66e41cd8c9, f62832cc17; test-only 288a375ba5, 1bcf7f50a4, abe32ad1c4 | WASI TCW3, TCW5, TCW7, TCW9, TCW10; TCM4 | Wasm EH in #5162, #5227 merged | blocked |
| UL16 | Bionic x86 scans TLS through __tls_get_addr | f1609f5143, test 0a4e8b9a9f | TC21 (Android) | ldc-developers/ldc#5313 merged, from the fork owner's #5311 | superseded |
| UL17 | Stack traces, .dSYM, uncaught exceptions on aarch64 | 6c9ae46094, 69b2aca9f5, 3fc6a23bd5, 9f51b0b2d5, 6b82ffcf7a, 7cb5c65c69; test 3e6235059b | TC18, TC19, TC21, TC22 | none | needs-work |
| UL18 | Runtime fixes: collections out of createLowLevelThread, importc.h under clang, vcruntime | 5d81911f60, 24b7022427, e41ee91cc1, ff472ff2c8; tests 1e8f386e3e | TC8, TC11, the Windows cross-build | none | needs-work |
| UL19 | Phobos submodule on PetarKirov/phobos (time zones under a TZDIR without a trailing slash) | 860cbe231d | TC22 (std.datetime.timezone runs) | see UP1 | superseded |
| UL20 | A scope lazy variadic array of delegates needs no closure | 0c89869f30 | As UD8 | upstream as UD8, reaching LDC through a frontend merge | blocked |
| UL21 | A closure's captures after a plain local still escape (no scope inferred for them) | c5b18c33b1; test parity 873265a00b | sparkles:test-harness benchCase (O14), any template registering closures | dlang/dmd#24243 merged (fixes #24065), not yet in LDC master | superseded |
| UL22 | ImportC: a member of an all-default compound literal of a zero-initialized struct (f((W){ { } }.wrapped)) | none: to fix in gen/llvmhelpers.cpp DtoSymbolAddress | Clay's CLAY(id, { }) through ImportC (worked around in the UI bench) | none; DMD compiles it | needs-work |
| UL23 | Copy an sret function's __result into the return value when a GC closure holds it (a return in an associative-array or opApply foreach body) | 341bb78fb7 | Any function that returns a struct from such a body and captures a local in a closure | none | needs-work |
| UL24 | --makedeps-probes: the import and string-import searches as their factors (roots, candidates, where each lookup resolved), not their expansion | b4d4cc7c65 | The build graph's manifests (BGK2): a compile's expanded list is megabytes | after UL11's -makedeps-absent | needs-work |
UL2 and UL3 are blocked on UL1 and on the LLVM entries UV1–UV2. UL14 is blocked on LDC adopting LLVM 24, and UL15 on UL14. UL6, UL9 and UL20 change the DMD frontend, so they are proposed to dlang/dmd and reach LDC with its next frontend merge; the fork drops them then. UL7, UL8, UL16 and UL21 are dropped at the next rebase onto a frontend that has their upstream fixes.
UL21 is the frontend bug behind benchCase's use-after-return (test-runner O14): checkAssignEscape stopped at the first variable a closure captures that is neither ref nor scope, so the parameters it captured after a plain local stayed inferable as scope. It is not LDC-specific: DMD 2.112.1 has it too, and DMD master, so the shell's DMD, has the fix. The reduction is LDC's tests/dmd/runnable/issue24065b.d.
UL22 fails with "no init symbol for zero-initialized struct": the frontend folds (W){ { } } to W.init and reads .wrapped through it, and LDC emits no init symbol for a zero-initialized struct. The reduction:
typedef struct { int a; } Inner;
typedef struct { Inner wrapped; } W;
void g(Inner i);
void h(void) { g((W){ { } }.wrapped); }The fix is to materialize a zeroed temporary for the lvalue there; it needs an LDC regression test and a full suite run, so it waits for the next LDC change rather than taking a toolchain bump of its own.
5. LLVM and Phobos
PetarKirov/llvm-project sparkles/main is LLVM main with 32 commits. The fork review covers 31 of them with their tests. No commit has been proposed by the fork, and the fork has no fix/* branches, so its entries are needs-work until each has one.
| ID | Change | Commits | Needed by | Upstream | State |
|---|---|---|---|---|---|
| UV1 | SPIR-V PhysicalStorageBuffer addressing and struct block wrapping for Vulkan | 88d6cd00e5 (Pham Quang Ha's) | SHT1 | llvm/llvm-project#216919 open | proposed |
| UV2 | The six SPIR-V changes SHT1 names, in its order | 7c6f682594, 391bbed1a8, 3592f59866 (amends UV1), 7ed8c4cae2, 211a3ab07d, 340fd88de7 | SHT1 | none; the module flag and metadata of 7c6f682594 need agreement | blocked |
| UV3 | Further SPIR-V lowering for the shader interfaces | fd8b2594fd, c8cd35917d, a179f26f88, 929b6bb879, 9fcf796e56, cefc4ed81e, d56b7d97a2, 06866a48d3, b62852ae29, 7578d189eb, ba75a9aa72, 1de563895a, 70b51b6381, d6e24f6100, c9dd5124e6, ce3d2ec16f, 4e59be36e8 | The shader specifications | none | needs-work |
| UV4 | GVN forwards a vector element as an extractelement | 41ccb17558 | Shader code generation | none | needs-work |
| UV5 | SelectionDAG falls back on sin and cos without an FSINCOS libcall (f128) | 1d775759c7 | Quadruple-precision real (TCW11) | none | needs-work |
| UV6 | Debug info for an enumeration based on an enumeration | e31c11bf0b | With LDC's 1cd64184fe (UL14) | none | needs-work |
| UV7 | libunwind, libc++ and wasm-ld for WASI | 2d833c467d, 739a6c7943, 54d4be7f9f, 275dcf2887 | TCW1, TC18; tech debt WTD36 | 2d833c467d matches llvm/llvm-project#168449, open | needs-work |
| UV8 | Clear the target lowering's used set per module (reproducible objects) | 019489a268 | TC15 | none | needs-work |
UV2 is blocked on UV1. UV8 is not yet in the fork review.
PetarKirov/phobos carries two commits, which LDC's Phobos submodule points at: 36f227da93 (UL19) and 9d9ceb18b3, which LDC's 66e41cd8c9 (UL15) moved the submodule to:
| ID | Change | Upstream | State |
|---|---|---|---|
| UP1 | std.datetime.timezone names zones under a TZDIR without a trailing slash | dlang/phobos#11011 merged, fixing #11000 | superseded |
| UP2 | std.socket references no getprotobynumber() on WASI, which wasi-libc declares and does not define | none; it needs a fix/* branch on upstream Phobos | needs-work |
UP1 and UL19 close together. The submodule goes back to ldc-developers/phobos once LDC's Phobos contains dlang/phobos#11011 and UP2's change, std.datetime.timezone's unittests pass on it, and a WASI preview 2 link that pulls in std.socket succeeds.
6. dlang.nix
PetarKirov/dlang.nix feat/ldc-sparkles is dlang.nix's main with the toolchain packages: ldc-vulkan and ldc-sparkles, llvm-spirv-vulkan, clang-sparkles, lld-sparkles, ldc-android, the WASI sysroots and runtimes, dmd-sparkles, and their tests. The same owner maintains dlang.nix, so the branch is upstreamed by merging it into main.
| ID | Change | Needed by | State |
|---|---|---|---|
| UN1 | The toolchain packages and the tests Nix runs for them | TC1–TC24, TCW1–TCW11 | blocked |
| UN2 | DMD 2.112 patched for time traces (4ef5441) and large writes (7bf1b17) | Nothing: dmd-sparkles replaced DMD 2.112 as the shell's dmd | fork-only |
UN1 waits on TCD2: it is proposed together with the fork commits it builds. UN2 is removed once nothing in Sparkles or dlang.nix builds DMD 2.112.
7. Order and blockers
Seven chains decide the order:
- Shaders. UV1 → UV2 → UL1 → UL2, UL3, UL4. Two pull requests by another author, llvm/llvm-project#216919 and ldc-developers/ldc#5132, block the whole chain. UV4, and UV3 except
cefc4ed81eand70b51b6381, which follow UV2's7c6f682594, can be proposed before UV1 lands. - DMD frontend first. UD3, UD8 and UD9 go to dlang/dmd, UD10 before UD8 so that UD8's test can run under
-inline(onfix/scope-lazy-variadicit keeps-inlineout of its permutations until then); their LDC copies UL6, UL20 and UL5 are dropped with LDC's next frontend merge. UL9 needs its dlang/dmd form written first. - Path mapping. UD2 and UL10 implement the same option and are proposed together, so that the two compilers agree on its meaning.
- LLVM 24. UL14 → UL15. LDC has to adopt LLVM 24 before the WebAssembly series can be proposed.
- Drops. UD4, UL7, UL8, UL16, UL19, UL21 and UP1 leave the forks at their next rebase (TCU4).
- Dependency output. UL11 → UL24: the probes option summarizes UL11's
-makedeps-absentsearches, so it is proposed after it. - Stale constant bytes. UD12, UD13 → UD14. With UD14 merged the push no longer reads the bytes UD12 and UD13 clear, so their tests pass without their fixes; proposed first, each is red on revert upstream. UD14's
fix/*message describes master before UD12, where the push carried an operand's address, and is rewritten for the zero upper half once UD12 is merged.
The rest (UD1, UD5, UD6, UD7, UD10, UD12, UD13, UL12, UL13, UL17, UL18, UL23, UV5–UV8, and US2, US4–US10) waits only on TCD2 and, for the LDC and LLVM entries, on its fix/* branch. UD11 is a report to file. UL22 is a fix still to write. US1 and US3 are fork-only (§3), US11 and US12 superseded; UN1 waits on TCD2 and UN2 leaves with DMD 2.112 (§6).
UD11 is a DMD glue bug found with UD10 and not fixed: a ref function that returns a call's ref result through a temporary with a destructor returns the address of a stack copy, because elemIsLvalue takes no *call() for an lvalue (for a struct returned through a hidden pointer it may point into a temporary being destroyed). Report text in §8.
8. Reports to file
UD8 pull request (from fix/scope-lazy-variadic; title "Fix #22885 - a scope lazy variadic array needs no closure"). The body is §2.1. The tests are runnable/test22885.d (semantics, evaluation order and count, struct temporaries, exceptions, deep recursion, zero allocations by GC.stats, a non-scope closure still correct after its frame is gone); runnable/test22885b.d (-betterC); compilable/test22885.d (call shapes, mangling, CTFE); and fail_compilation/test22885.d, test22885b.d and test22885c.d (escapes, override, a non-scope array still allocates).
UD10 issue (dlang/dmd; no existing issue found). Title: "Reading a field of a temporary reads it after the temporary's destructor". Body:
struct T { int v; ~this() { v = -1; } int get() { return v; } }
int f() { return T(9).v; } // -1
int g() { return T(9).get; } // -1 with -inline
int dg(int delegate() d) { return d(); }
int lz(lazy int x) { return x; }
void main()
{
assert(f() == 9);
assert(dg(() => T(9).get) == 9); // -1 with -inline
assert(lz(T(9).get) == 9); // -1 with -inline
}The value of a full expression is read after its temporaries are destroyed whenever that value is an lvalue: the glue's appendDtors takes the lvalue's address, runs the destructors, then reads through it. -inline turns any member call on a temporary into that form, so delegate literals and lazy arguments hit it too. LDC is correct.
UD10 pull request (from fix/temporary-lvalue-dtor; title "Fix #(the UD10 issue) - read a full expression's value before destroying its temporaries"). Only a ref return and an RVO return through the hidden pointer need the lvalue; toElemDtor now says so, and every other caller gets the value copied before the destructors run, as a non-lvalue result already was. Test: runnable/dtor_temp_lvalue.d (field, member call, a static array field, delegate literal, lazy once and twice, a condition, a ref return that still returns the variable itself), under the default permutations.
UD11 issue (dlang/dmd; no existing issue found). Title: "ref return of a call's ref result through a temporary returns a stack copy":
int g = 5;
struct Bump { int* p; ~this() { *p = 99; } ref int get() { return *p; } }
ref int r() { return Bump(&g).get; }
void main() { assert(&r() is &g); } // fails: the address of a copy