Skip to content

Upstream PRs: tracking (Marek's open PRs on upstream) #14

Open
3 of 7 issues completed
Open

Description

@mareklangiewicz

Parent issue. Upstream is mentioned as plain text here ("upstream EmmyLuaLs#1364"): in this repo, #1364 would mean a fork issue.

Whether to draft, mark ready, ping, or close an upstream PR is Marek's call. Agents prepare things locally. Before writing an upstream PR from a fork fix, re-measure on upstream main (corpus diff with upstream main as base, plus "before" tests run against main's source). Fork numbers don't carry over (see AGENTS.md).

Open upstream PRs, measured (generated)

Measured against upstream main 2d2374fa (gndx emmylua prs --write regenerates it):

upstream PR draft branch behind main mergeable size last corpus run
1335 no fix-union-member-hover-1321 0 MERGEABLE +78 −1, 2 file(s) —
1337 no fix-metatable-index-declared-type-1319 0 MERGEABLE +133 −2, 5 file(s) —
1338 no feat-partial-field-docs-1318 0 MERGEABLE +137 −3, 5 file(s) —
1340 no fix-string-table-index-1334 0 MERGEABLE +607 −56, 10 file(s) ci-c06b109f-1205
1341 no fix-object-index-undefined-field 230 MERGEABLE +36 −1, 2 file(s) —
1353 no up-cross-file-call-return 204 MERGEABLE +194 −3, 2 file(s) —
1355 no up-duplicate-set-field-nested-target 0 MERGEABLE +62 −11, 2 file(s) —
1359 no up-decl-return-slot 36 MERGEABLE +207 −1, 3 file(s) declslot-97ce97cd-1126
1361 yes up-member-falsy-branch 202 MERGEABLE +69 −2, 2 file(s) ci-d17e72a1-1205
1362 no up-class-overload-callable 0 MERGEABLE +109 −8, 2 file(s) —
1364 yes fix-table-field-param-docs 0 MERGEABLE +224 −89, 8 file(s) ci-df3a04eb-1205
1367 yes fix-index-write-value-type 0 MERGEABLE +187 −4, 2 file(s) ci-5ffe2291-1205
1368 no fix-global-member-type-across-files 45 MERGEABLE +73 −1, 3 file(s) —
1370 no fix-closure-param-cycle-guard 198 MERGEABLE +45 −2, 2 file(s) —
1371 no fix-solver-self-mentioning-binding 0 MERGEABLE +36 −3, 2 file(s) —
1423 no fix-missing-member-nullable-param 45 MERGEABLE +41 −0, 2 file(s) —
1437 no fix-record-field-order 0 MERGEABLE +55 −1, 2 file(s) —
1447 no up-member-write-skip-path 0 MERGEABLE +253 −5, 2 file(s) —
1448 no fix-arg-min-last-required 45 MERGEABLE +37 −3, 2 file(s) —
1449 no fix-attribute-overload-arity 45 MERGEABLE +43 −19, 4 file(s) —
1450 no fix-enum-key-base-type 45 MERGEABLE +207 −39, 2 file(s) —
1451 no fix-missing-member-of-unresolved-type 0 MERGEABLE +101 −13, 3 file(s) —
1458 no perf-member-use-named 0 MERGEABLE +86 −1, 3 file(s) —
1465 yes fix/resources-stamp 36 MERGEABLE +117 −46, 1 file(s) ci-2a41140c-1205
1471 yes fix-union-any-member-missing 36 MERGEABLE +68 −2, 2 file(s) ci-34104d13-1205
1473 yes fix-call-prefix-first-result 20 MERGEABLE +31 −2, 2 file(s) ci-cba52785-1205
1512 yes fix-module-own-members-first 0 MERGEABLE +70 −0, 2 file(s) own-97095b92-1205
1514 yes fix-meta-dotted-class-path 0 MERGEABLE +124 −0, 3 file(s) port-b22d95c1-1205
1515 yes fix-global-class-table-members 0 MERGEABLE +71 −3, 2 file(s) pkgpath-802126e8-1205
1517 yes fix-dynamic-index-guard 0 MERGEABLE +336 −43, 5 file(s) guard-1c3eb136-1205

Open upstream PRs: what each one is (state as of 2026-11-17)

upstream PR draft branch what
1335 no fix-union-member-hover-1321 2026-12-05: main 2d2374f merged in (36af75b, pushed), MERGEABLE; test-file conflict only; both tests RED on main's build_hover.rs, GREEN here. Before: hover: field docs for members read through a union (upstream issue 1321)
1337 no fix-metatable-index-declared-type-1319 2026-12-05: main 2d2374f merged in (175a240, pushed), MERGEABLE. PARTLY SUPERSEDED: main lets a member's ---@type win in member_type, so the member_type and types.rs parts were dropped; kept: signature_returns unknown row + metatable_index_is_closure (each alone RED on main for test_issue_1319_guarded_return_keeps_both_paths). Title + body rewritten 2026-12-05 (dropped part explained, Part of #1319). Before: declared member type beats __index (1319)
1338 no feat-partial-field-docs-1318 2026-12-05: main 2d2374f merged in (7fb99f3, pushed), MERGEABLE; main already accepts the Partial<T> literal; the docs half (member.rs + access.rs) RED on main for both docs tests, GREEN here. Before: Partial<T> fields accepted, keep T's docs (1318)
1340 no fix-string-table-index-1334 2026-12-05 (later): refactored 1517 merged in as c06b109 (local, NOT pushed): PathProofs { guards, assigned } replaces the guarded flag; vm.rs left as is (porting the fork's shape there means moving upstream's union arm). CI 3093 tests + lint pass; corpus ci-c06b109f-1205 vs ci-df4bcc38-1205: 56648 → 56648, 10 changed lines, all record-order flips (diffview, gitsigns, nui, lspconfig); vs main still 83 new-only (unchanged). Before: 2026-12-05: STACKED on upstream 1517: 645b060 merged in (8ae9045, brings main 2d2374f) + write-settles df4bcc3 (fork 6ccc474), pushed; tree = the audited stack1340-1d5a8f11-1205 (CI 3093 tests + lint pass); write test RED on 645b060, GREEN on df4bcc3; body gained a "Stacked on EmmyLuaLs#1517" section. Audit: comment 7442027766. Before: 2026-11-26: main 4c18e8e merged in (886db49, lint fix 2e64d8d) and the cost fixed (6911ca1), pushed; MERGEABLE; explained in a PR comment (2026-11-26). The cost: the missing-member fallback asked undeclared types (vim.Range, TSNode) for an index signature, which marks the query incomplete and sweeps the caches on every read (gitsigns +77%, refactoring +91%, snacks +32%); names_undeclared_type answers None first. After: ab within noise (gitsigns +0.9%, refactoring −1.1%, snacks +2.5%), corpus vs main +124 net over 541 lines (321 agree with 0.25.1), CPU 49.4→50.2 s; the fix alone removed 43 sweep-made false hits (none on main or 0.25.1). Regression test pins the cache revision (red on the branch, green on main's files). index signature reads have the value type (1334)
1341 no fix-object-index-undefined-field undefined-field accepts keys matching an object index signature
1353 no up-cross-file-call-return a call to another file's member closure returns its signature
1355 no up-duplicate-set-field-nested-target 2026-12-05: main 2d2374f merged in (34d7b26, pushed), MERGEABLE. HALF SUPERSEDED: upstream 76c776b (receiver-path grouping) covers the nested-target half, so set_table_path was dropped; kept: the nil-module-field half (RED on main). Title + body rewritten 2026-12-05 (nil-field half only). Before: duplicate-set-field on different tables and nil module slots
1359 no up-decl-return-slot READY 2026-11-26: 97ce97c pushed, body updated (guard + corpus), CI 15 pass, marked ready, MERGEABLE. Before: 2026-11-26 (comments 7196565503, corrected by 7199113155): mini.icons WAS a 1359 bug: the port dropped the fork's is_value_list guard on the any fallback. Fixed in 97ce97c (local, NOT pushed; test RED→GREEN, 1997 pass, lint pass; corpus vs main: 95 lines, −53 net, 74 agree). The other adds are correct reports or main bugs (fork fixes e7f7c4b, ddd327e, both with no upstream PR). Push, then ready-or-hold: Marek's call. Before: 2026-11-26: main 4c18e8e merged in and pushed (5366d8b), MERGEABLE; tests 1996+243, lint pass. Corpus on 4c18e8e: −52 net over 138 lines, 95 agree with 0.25.1 (unchanged from 48ef52a); CPU 49.4→50.2 s. Still draft; bot review answered 2026-11-26 (claims re-probed on 5366d8b and main 4c18e8e). Before: NOT READY 2026-11-23: merged locally (worktree declslot, 28ab072). Corpus on 48ef52a: −52 net, 92 of 132 lines agree with 0.25.1, but adds suspect lines (treewalker heading.lua:157 expected nil but found integer?, telescope make_entry.lua:131). Read 2026-11-24 (comment): both are main bugs it exposes (treewalker = main's local x = nil contract, fork 3dcb757, no upstream PR yet); bot reply redrafted there. local a, b = f() gives each target its own slot
1360 no up-flow-memo-guards SUPERSEDED 2026-12-05: test_and_narrows_after_merge_of_earlier_guard is RED on the PR's base 4136671 and GREEN on main 2d2374f without the change. CLOSED 2026-12-05 (Marek), comment 7429385942. Before: a memoized flow state keeps the guards a later query brings. Main merged in 43f8b0e (2026-11-17); body updated with the corpus trace (comments below)
1361 yes up-member-falsy-branch 2026-12-05: judge --onto=origin/main (merge ci-d17e72a1-1205 of the PUSHED head cb8b58d on main 2d2374f): CI 3086 tests + lint pass; AUDITED 2026-12-05: 33 new-only lines (35 hits), none caused by 1361's rule. Noise refolded over three 30 s runs of main (ci-2d2374fa-1205 + corpus rerun -2, -3; the earlier -2, -3 were 120 s lab runs, not comparable, dropped): 5 lines folded (blink sources ×2, diffview config:309, gitsigns compat:152, nui tree:240). Mechanism: main erases the owner on the false branch of a member test (if c.handle then return end, assert(not self.handle)): every later check on it goes silent (local _ = c.nope: 0.25.1 and 1361 report undefined-field, main nothing). 1361 keeps the owner, so its added lines are main's own checks unmasked. Controls (guard removed, else unchanged): snacks spawn.lua:166-168 self.stdin may be nil and conform init.lua:602 found nil ×2 are reported by main itself without the guard; the fork reports neither false form (spawn: none; conform: found integer?), so they are main bugs the fork already fixes, not 1361's. Not reduced one by one: gitsigns diff.lua ×6 (a 3-value return read as one slot), scratch/terminal/lualine/diffview logger/convert found nil, member need-check-nil on self (snacks picker ×3, telescope ×2, oil, flash, diffview); same shape (code past a falsy member guard). PR-wise: an honest unmasking; the added lines are main's imprecision showing, which reviewers may read as noise from the PR. The local branch has an unpushed main merge + 17f9a2e4. Before: NOT READY 2026-11-23: on main 48ef52a snacks.nvim times out (>120 s; main 7.6 s). Cause found (comment 2026-11-23): an upstream main hang that 1361 only exposes, fixed by upstream 1365; 1361 + 1365's 5294c22 finishes snacks in 7.3 s. Waits on 1365. Local merge + bot follow-up 17f9a2e4 in worktree falsy, NOT pushed. false branch of a member test keeps owners whose member can be falsy
1362 yes up-class-overload-callable 2026-12-05: main 2d2374f merged in (ba202fd, pushed), MERGEABLE; conflict = upstream's Option<bool> callability + alias_callability (8238cb0, b740a84), the @overload and generic-class rules re-placed in it (has_call_candidate); both PR tests RED on main's checker, GREEN here; 17 call_non_callable tests pass. Before: READY 2026-11-23: main merged in, bot review answered (15abbd8: generic alias + unresolved base tests). Corpus on 48ef52a: −114 call-non-callable, all agree with 0.25.1. macOS CI jobs cancelled (no runner); re-run asked. a class's @overload makes it callable (the fork's biggest load-bearing fix: 2242 hits)
1364 yes fix-table-field-param-docs 2026-12-05 (later): main 2d2374f merged in LOCALLY (df3a04e, worktree fieldparamdocs, NOT pushed): the definition_test.rs conflict was both sides adding tests, kept both (the file differs from main by the branch's one test). judge --onto=origin/main: CI 3094 tests + lint pass; corpus FAIL, 21 new-only lines (57 noise folded over 3 runs of main, 30 s): LazyVim 10, diffview 10 (render.lua panel.components.* need-check-nil 7), lspconfig 1, sidekick 1, snacks 1 (one LazyVim line and the two diffview render.lua:216 hits count in these). Expected class: a field function's body now sees its ---@param types; 0.25.1 flags most of these lines too (undefined-field on the same member). Not read line by line. Earlier 2026-12-05: refused: head 3e4032d conflicts with main 2d2374f in emmylua_ls definition_test.rs. Before: 2026-11-26: main 4c18e8e merged in and pushed (3e4032d), MERGEABLE; tests 2000+245, lint pass. Corpus on 4c18e8e: +52 net over 85 lines (need-check-nil +22, undefined-field +22, preferred-local-alias +7: as on 48ef52a); CPU 49.4→50.5 s. Still draft. Before: NOT READY 2026-11-23: merged locally (worktree fieldparamdocs, 7b68eb5). Corpus on 48ef52a: +53 net (need-check-nil +22, undefined-field +22, preferred-local-alias +7); the undefined-field ones mostly match 0.25.1. Read 2026-11-24 (comment): 39 lines are on the fork too; the 19 that are not are main's unresolved-member nil (upstream 1451) and index-signature reads (1340). ---@param on a table-field function reaches its body
1365 no fix-union-eq-repeated-member CLOSED 2026-12-05 (Marek): superseded by upstream b740a84 (union refactor dedups members in LuaType::union; from_vec goes through it). Both PR regression tests pass on main 2d2374f without the complex.rs change. Before: a union with a repeated member equals itself (async.nvim overflow). 2026-11-23: merged main 48ef52a (435e835), + hang test 0ed22c1 (snacks.nvim fixture: main hangs since upstream EmmyLuaLs#1418; red 10/10, green 10/10), pushed; corpus up1365-1123: async.nvim, bufferline.nvim, neovim-runtime now finish, no stable hit change (13 lines = main's own flips); body + comment updated. Worktree uniondupeq. Unblocks 1361.
1367 yes fix-index-write-value-type 2026-12-05 (later): main 2d2374f merged in LOCALLY on top of 9ad4012, clean (5ffe229, worktree indexwrite, NOT pushed). judge --onto=origin/main: CI 3087 tests + lint pass; corpus FAIL, 36 new-only lines (61 noise folded over 3 runs of main, 30 s): 34 assign-type-mismatch on index writes (the PR's check), 1 inject-field, 1 unnecessary-if; lazy 7, snacks 6, gitsigns 5, neovim-runtime 4, diffview 3, diffs 3, trouble 3, which-key 2, others 1. The class the 2026-11-24 comment explains (fork-also + main's index-read bug, upstream 1334 / PR 1340); not re-read line by line. Earlier 2026-12-05: judge --onto=origin/main refused: the pushed head b16a9ca conflicts with main 2d2374f in assign_type_mismatch.rs (the local branch holds an unpushed merge of main 48ef52a, 9ad4012). Before: NOT READY 2026-11-23: ported locally onto main (worktree indexwrite, 9ad4012, not pushed; class check via class_contract_for_owner, index_key_type re-added). Corpus on 48ef52a: +60 assign-type-mismatch, +18 inject-field (old base: +11). Explained 2026-11-24 (comment): 51 of 78 are on the fork too (annotations, main's literal inject-field rule); 27 are main's index-read bug (upstream 1334 / PR 1340) showing through. Waits on 1340 like 1361 on 1365. a write through a table index is held to the value type (fork e1b65c9)
1368 yes fix-global-member-type-across-files READY 2026-11-23: ported onto main's MemberUse resolve_member (63eb37e), bot review answered (285f472). No corpus change on 48ef52a. macOS CI job cancelled (no runner); re-run asked. a global member's ---@type holds in every file
1370 no fix-closure-param-cycle-guard closure param evaluation inherits the cycle guard (tuis.nvim overflow). CppCXY's clone question answered 2026-11-17, no reply yet
1371 no fix-solver-self-mentioning-binding 2026-12-05: main 2d2374f merged in (17cf6d8, pushed), MERGEABLE; test-file conflict only; the test overflows its stack on main's function_solver.rs, GREEN here. Before: binding mentioning a bound generic stays out of the solver (mason.nvim OOM). Conflicts resolved 2026-11-17 (main merged in 5f7d76f), as CppCXY asked
1421 yes fix-bare-question-optional bare ? type literal lowers to nil, so LuaLS `T
1445 yes fix-bare-question-optional MERGED 2026-11-23 (upstream commit 53c20d3): bare ? lowers to nil, so ---@param n integer|? is optional (param half of 1421, fixes upstream issue 1425; #37, closed)
1423 yes fix-missing-member-nullable-param READY 2026-11-23: main merged in (conflict: both sides appended a test), bot review answered (a7c3980). Corpus on 48ef52a: −226 param-type-mismatch, all agree with 0.25.1. a missing union member is nil only for a param that rejects nil (fork a5c2132, #40)
1447 yes up-member-write-skip-path 2026-12-05: main 2d2374f merged in (91025b2, pushed), MERGEABLE; flow.rs conflicts = upstream's Result<_, DeferredMemberRead> walk, member_entry_type kept at the walk-start spots; 4 of 6 tests RED on main's flow.rs, GREEN here; 252 flow tests pass. Before: READY 2026-11-20 (opened as draft the same day): a member read before its write starts from the declared field; a function statement and a bare-nil read keep the old base (fork 72c462e → 67e6bfb, #41). Bot review answered at 2c009e2; rule narrowed in 76f8fb5, regression test a9affd2, body rewritten 2026-11-21. CI green. Awaiting maintainer review
1437 yes fix-record-field-order 2026-12-05: main 2d2374f merged in (f294f2c, pushed), MERGEABLE; test-file conflict only (both appended); test RED on main's simple_type.rs ({10,11,12}), GREEN here; 113 assign_type_mismatch tests pass. Before: READY 2026-11-23: main 48ef52a merged in (7c47b1f), bot review answered. 4-run repeat on the noisy trees: main varies on 16 lines in 4 files, this on 5 lines in blink only. a record literal's first mismatching field is the same every run: fields walked in key order, not hash order (fork 29b1a45, #59; addresses one source of upstream issue 1091)
1448 yes fix-arg-min-last-required READY 2026-11-23 (opened as draft 2026-11-22): the argument minimum is the last required param's position (fork 9115450, #78). 1445 merged; main 48ef52a merged in (1e001d7, 2026-11-23): +8 true missing-parameter, obsidian's 25 false hits gone; body updated
1449 yes fix-attribute-overload-arity READY 2026-11-23 (macOS jobs cancelled, no runner; re-run asked). attribute overload arity takes the last required param's position; hover reuses the checker's helper (fork 178f8ab, #81). Opened 2026-11-22. Re-measured on main 48ef52a (0f3a1ee, 2026-11-23): no corpus change.
1450 yes fix-enum-key-base-type READY 2026-11-23 (opened as draft 2026-11-22; re-measured on main 48ef52a, 02a8a83): an enum or named key fits a table of its base type; numeric_key_expanded removed (fork dbcc1da+c0e09ab1+1c80f90a+e18788c1, #82). The upstream corpus can't see it (all hits are in neovim-runtime)
1451 yes fix-missing-member-of-unresolved-type 2026-12-05: main 2d2374f merged in (d5616bb, pushed), MERGEABLE; test-file conflict only; RED on main's vm.rs, GREEN here. Before: READY 2026-11-23 (opened as draft 2026-11-22): a member missing from an unresolved name or an alias of a union is unknown, not nil (fork 8f00f19+4a14dd93, #83). Re-measured on main 48ef52a (1f72bc3): −2866 corpus hits; the blink config/sources.lua variation is main's own noise
1456 yes perf-flow-read-memo MERGED 2026-11-24 (upstream merge commit 1460735). Was READY 2026-11-23 (CI green, bot review answered at 0a68b20): a value read stops at the memo after a skipped merge and at a write (port of fork d9b600a + the memo half of 1f7c158 onto main 48ef52a; 3262c88 and the token half of 1f7c158 serve fork-only code). Opened 2026-11-23: 6400 × x = x + 1 115 s → 0.30 s, 1600 untouched merges 7.1 s → 0.20 s; corpus unchanged
1458 no perf-member-use-named 2026-12-05: main 2d2374f merged in (2b97f7a, pushed), MERGEABLE; upstream deleted phase_tests/ (92d2e12), so the p10 test moved to semantic_db/tests/query_tests.rs (test_named_members_are_the_full_list_filtered_by_name); perf test times out (5 s) on main's query.rs, GREEN here; 212 tests pass. A name-keyed member use reads the owner's by-name bucket in resolve_member_id
1465 yes fix/resources-stamp 2026-12-05: judge --onto=origin/main (merge ci-2a41140c-1205 on main 2d2374f): CI 3087 tests + lint pass; 1 new-only line with noise folded over 3 runs of main (--noise=ci-2d2374fa-1205, reruns -2, -3; main alone flips ~60 lines run to run, the #59 record-order class): diffview config.lua:309 assign-type-mismatch, a record-order flip main shows at that line pair too (the PR touches only the resources stamp). PASS in substance. Before: Opened as draft 2026-11-26: an unpacked resources dir is stamped VERSION+<hash of the embedded files>, judged in that dir, and the embedded trees are removed before an unpack (fork b596edb, #93; the same file as on the fork, applied cleanly onto main 4c18e8e as d6bd22c). On main: both tests red on their mutants (bare-version stamp, skipped removal), full suite 1995 and lint pass. No corpus leg: emmylua_check never reads the unpacked copy
1471 yes fix-union-any-member-missing 2026-12-05: judge --onto=origin/main (merge ci-34104d13-1205 on main 2d2374f): CI 3088 tests + lint pass; 0 new-only lines with noise folded over 3 runs of main (--noise=ci-2d2374fa-1205, reruns -2, -3; main alone flips ~60 lines run to run, the #59 record-order class) (unfolded: 4). PASS. Before: Opened as draft 2026-11-26. Pushed 2026-11-26 (3e470e6 on main 4c18e8e); A union with an any/unknown component has no missing member (fork ddd327e). Tests RED→GREEN (any|string, unknown|string; the fork's pcall test was NOT RED on main, replaced), 1996 pass, lint pass. Corpus unionany-3e470e68-1126 vs main: −11 param-type-mismatch, all agree with 0.25.1, no adds
1473 yes fix-call-prefix-first-result 2026-12-05: judge --onto=origin/main (merge ci-cba52785-1205 on main 2d2374f): CI 3086 tests + lint pass; 0 new-only lines with noise folded over 3 runs of main (--noise=ci-2d2374fa-1205, reruns -2, -3; main alone flips ~60 lines run to run, the #59 record-order class) (unfolded: 4, all in that class). PASS. Opened as draft 2026-11-26: a call used as a prefix is read as its first result in need-check-nil
1472 no fix-nullable-integer-arithmetic READY 2026-11-26 (Marek). 2026-11-26: fork 45ec12c ported as e7d8170 (one raised_on_nil for # and -; the first port had left it out), pushed, body updated; corpus unchanged vs 298256f (57856 = 57856, only #59 flips). 2026-11-26: the 27 unexplained adds read (comment 7201050437): one 1472 defect, #x with no len answer kept the operand's nil (1 + #t[1] on any[]). Fixed in 298256f (squashed with a test-helper cleanup, pushed 2026-11-26; test RED→GREEN, 1998 pass, lint pass); corpus nilarith-ea6fd33a-1126 vs 055f184: need-check-nil −3 (the 3 lines), param −8 and assign −2 (lengths no longer nil-typed, mostly agree with 0.25.1), the rest #59 flips (corpus repeat: diffview config.lua, gitsigns compat.lua vary); ab vs main within noise. PR body updated 2026-11-26 (corpus need-check-nil +322 on 293 lines, 185 agree; param −48; assign −24 +5; the 27-line reading); still draft; ready-or-hold: Marek's call. Before: Opened as draft 2026-11-26. Pushed 2026-11-26 (2d41b6e + 055f184 on main 4c18e8e); integer? - 1 is integer, arithmetic and # on a nullable operand are need-check-nil (fork e7f7c4b+65c2b821, 4391566). Adapts 3 upstream tests (test_inline_variable_cast_in_arithmetic, the two #calls loop tests). Large effect: corpus nilarith-055f1846-1126 vs main: need-check-nil +325 on 297 lines (186 agree with 0.25.1; 27 lines neither 0.25.1 nor fork report), param −40, assign −21+4, return −3. Body asks upstream whether the number channel is deliberate
1517 yes fix-dynamic-index-guard 2026-12-05 (later): IndexTarget refactor ported as 1c3eb13 (local, NOT pushed): one key list (IndexTarget { owner, keys: Vec<TargetKey> }), one wildcard rule in path_write_affects, guarded_on_all_paths returns each path's proof. CI 3088 tests + lint pass; corpus guard-1c3eb136-1205 vs guard-645b0609-1205: 56633 → 56633, 6 changed lines, all the record-order flips main shows run to run. Diff vs main grows +122 → +147 in flow.rs. Before: Opened as draft 2026-12-05 (Marek's go-ahead): a dynamic index guard holds when its key is a stable path or a length (fork cd052a7 on main 2d2374f, 645b060). 2 of 3 tests RED on main's flow.rs + flow/receiver.rs; CI 3088 tests + lint pass; corpus guard-645b0609-1205 vs main −115 (80 lines, 74 agree with 0.25.1), 3 added lines none from the rule. Upstream 1340 is stacked on it

Merged so far: 1304, 1305, 1336, 1354, 1372, 1373, 1445, 1456.

Regenerate the fork↔PR mapping with gndx emmylua fork rather than editing it by hand. Upstream main still has the quadratics fixed by fork 3262c88 / d9b600a / 1f7c158 (measured on 48ef52a, 2026-11-23: 6400 × x = x + 1 takes 115 s upstream, 0.33 s on the fork; 1600 untouched merges 7.1 s vs 0.23 s). The 2026-11-08 hold is lifted: Marek, 2026-11-23, "We shouldn't hold back any speedups." They are being ported upstream.

Sub-issues: candidates for new upstream PRs, and local branches waiting for a decision.

Sub-issues

Sub-issues

3 of 7 Issues completed
Loading 7 sub-issues

Activity

  1. mareklangiewicz commented on Nov 17, 2026

    @mareklangiewicz
    OwnerAuthor

    2026-11-17: upstream 1360, 1371 merged with main; 1370 answered; 1423 opened

    • 1371: CppCXY asked to resolve conflicts. Merged main 4136671 in 5f7d76f (pushed): only a test-file conflict, both tests kept, 1911 tests pass. Short reply posted.
    • 1370: answered CppCXY's "Is clone really appropriate here?" on vm.rs:781: upstream's own type_of_expr_inherit clones computing the same way; the set holds the in-progress chain (nesting depth) and clones only on a closure_params cache miss. Offered std::mem::take + restore instead.
    • 1360: merged main in 43f8b0e (pushed). Conflicts were comment-only: main renamed "loop-free" to "outside a cycle" (is_in_cycle, upstream 1401). 1912 tests pass. The bug is still on main: the PR's test_and_narrows_after_merge_of_earlier_guard fails on 4136671 alone.
      • Corpus up-41366714-1117 → memo-43f8b0ea-1117: 58021 → 57696, 706 changed lines. Removed 508 (488 agree with 0.25.1), added 198 (30 agree). assign-type-mismatch +36 −36 and undefined-field +23 −23 balance (constructor-field flakiness as in Quirk: which failing constructor field gets reported flips between runs #9, plus moved lines).
      • One added unnecessary-if (LazyVim util/cmp.lua:156, if session then where session = active() and snip._session or nil and _session is only ever assigned nil) reduced to a fixture: main reports that if when nothing sits between the assignment and the if, and misses it when an unrelated if not ok then … end does. The branch reports both. With _session typed table?, main wrongly reports the if and the branch doesn't. So that added hit is the memo no longer hiding a guard. The other added categories (param-type-mismatch 32, need-check-nil 21 not agreeing) are not traced yet.
      • The PR body's blast-radius table predates this corpus; updating it is Marek's call.
    • 1423 opened (draft) for Upstream PR candidate: a missing union member is nil only for a param that rejects nil (fork a5c21324) #40.
  2. mareklangiewicz commented on Nov 17, 2026

    @mareklangiewicz
    OwnerAuthor

    Upstream 1360: the added corpus lines, traced (2026-11-17)

    Follow-up to the comment above. 53 added param-type-mismatch / need-check-nil lines (memo-43f8b0ea-1117 vs up-41366714-1117) don't agree with 0.25.1.

    Method: a reference build of main 4136671 with trace_decl's memo off (if true || tree.is_in_cycle(flow_id)), i.e. the uncached walk the memo is meant to cache. Control: on 1360's own repro it reports 0 need-check-nil, like the branch (main: 1). Run per tree under MemoryMax=3G MemorySwapMax=0, 180 s.

    • 41 of 53: the reference reports them too. These are hits the memo was hiding.

    • diffs.nvim (11): the reference times out even at 900 s (exponential without the memo), so these were read by hand.

      • runtime/cache.lua 233, 251, 254, 256, 259, 266 (self.hunk_cache / self.ft_retry_pending may be nil): main already reports the same message on almost every other read of those fields in the file (170, 212, 225, 273, 283, 294–296). The branch fills in the reads main skipped. The message itself is wrong (both fields are declared non-optional), and main already has it.
      • commands.lua 2207, 2218, 2225, 2242: same hits, better messages. Main said found nil for diff_lines, the branch says found string[]?.
      • review.lua:559: normalized.target after if not normalized.target then return end reads string?. A fixture shows main reports this too, with no memo involved: a member guard doesn't hold when the receiver is a local narrowed from Norm? by if not normalized then return end. Main's memo hides it in the real file.
    • which-key mappings.lua:258 (1): differentially reduced (branch reports found nil, main doesn't) to: ---@cast mapping wk.Mapping|wk.Spec; if mapping.desc == "x" then mapping.desc = nil end; if mapping.group and mapping.desc then mapping.desc = mapping.desc:gsub(…). The cause is main's member flow after a conditional write:

      ---@param s S        -- S: ---@field desc? string
      local function f(s)
        if c() then s.desc = "x" end
        local probe = s.desc   -- 0.25.1: string?; main 41366714 and the fork: string
      end

      Main drops the path that skips the write. The fork has the same bug. With a union receiver (M|S), 1360 lets unnecessary-if see that wrong type, which gives the added "Impossible/Unnecessary if" hits on code like that. Separately, the missing-union-member rule reports a colon call's receiver at the first argument's range (258:39 is "^%+").

    Verdict: no added line comes from 1360's own logic. Each one is either the uncached walk's answer or an existing main bug that the memo was hiding. Two of those main bugs are worth their own fork issues: the conditional member write dropping the skip path, and a member guard not holding on a nil-narrowed receiver. 1360 makes the first one visible as false unnecessary-if hits.

    Side note: on diffs.nvim restricted to runtime/cache.lua + the 29 type files, the branch ran in 7 s and main in 62 s.

  3. mareklangiewicz commented on Nov 17, 2026

    @mareklangiewicz
    OwnerAuthor

    Upstream 1360's body updated (2026-11-17): the three-codebase blast-radius table is replaced by the 54-tree corpus numbers above (508 removed / 488 agree with 0.25.1; 198 added, traced), and the main bugs it exposes are described (#41, #42). Speed note gained the 62 s → 7 s diffs.nvim measurement.

  4. mareklangiewicz commented on Nov 23, 2026

    @mareklangiewicz
    OwnerAuthor

    2026-11-23: every open draft re-measured on upstream main 48ef52a

    Each branch had main 48ef52a merged in, then gndx emmylua test, a red run of its new tests against main's source (--red-at=origin/main:…), lint, and a full corpus run diffed against up-48ef52a0-1123. All new tests go RED → GREEN on main.

    Marked ready: 1448, 1449, 1450, 1451, 1437, 1423, 1362, 1368. Bot reviews answered on 1437, 1423, 1362 and 1368. 1362, 1368 and 1449 show cancelled macOS build jobs (the jobs never got a runner; no step ran), and a re-run needs maintainer rights, so each PR has a one-line ask.

    Not ready (merges and follow-ups committed locally in their worktrees, NOT pushed; the PRs still sit on their old bases):

    • 1361 (falsy): snacks.nvim times out at 120 s on the branch, twice; main does it in 7.6 s. The fork carries the same rule (4c1949d) and finishes snacks, so upstream likely needs a fork-only speedup first (Marek's 2026-11-08 hold covers those).
    • 1367 (indexwrite): the port onto main's rewritten checker adds +60 assign-type-mismatch and +18 inject-field (the old base added 11). Not yet explained: main's changed value inference, or the port (class check now class-only via class_contract_for_owner; index_key_type re-added).
    • 1364 (fieldparamdocs): +53 net; the +22 undefined-field mostly match 0.25.1 (docs now type the closure params), the +22 need-check-nil (13 in diffview) and +7 preferred-local-alias are unread.
    • 1359 (declslot): −52 net, 92 of 132 lines agree with 0.25.1, but adds suspect lines such as treewalker heading.lua:157 expected nil but found integer? (the past-the-end-is-nil slot rule the bot questioned). Bot reply drafted, not posted.

    Corpus runs kept: up1437-1123, up1423-1123, up1359-1123, up1361-1123, up1362-1123, up1364-1123, up1367-1123, up1368-1123, rep1437-1123-*; snk1361-1123 is scratch.

  5. mareklangiewicz commented on Nov 23, 2026

    @mareklangiewicz
    OwnerAuthor

    1361 snacks.nvim timeout, first look (2026-11-23): upstream 1456 does not fix it (1361 + 1456 still times out at 120 s). gdb at 40 s (gndx emmylua stack): need_check_nil → type_of_expr_at → flow::member_type_more_specific → type_check_cached → Comparisons::intern on big unions. member_type_more_specific and comparison.rs are identical on the fork and main, so the fork keeps those unions smaller or reaches them less through another of its flow.rs changes; not bisected yet. Side finding: with 1361 alone, the untouched-merge chain read is quadratic (3537 flow steps at n = 16) and 1456 makes it 485.

  6. mareklangiewicz commented on Nov 23, 2026

    @mareklangiewicz
    OwnerAuthor

    1361's snacks.nvim timeout is an upstream main hang, fixed by upstream 1365 (2026-11-23)

    • Reduced snacks.nvim to 2 files (files, then lines, while main stayed >8 s). Upstream main 48ef52a itself never finishes them (>90 s, flat 60 MB); 0.25.1 and the installed fork 4a14dd93 take 0.17 s. On the full tree main only gets lucky; 1361's false-branch rule routes snacks into the same shape.
    • Upstream bisect (first-parent 0.25.1..48ef52a0, fixture, 5 s cutoff): first bad 280987f = upstream fix(flow): avoid false nil warnings in guarded and metatable reads EmmyLuaLs/emmylua-analyzer-rust#1418 need-check-nil rewrite (one commit, 6f69ff1). The fork's merge of it (03cbf9f) was fast from the start.
    • Instrumented member_type_more_specific on main: the run hangs in type_check(DocFunction{ret: Table|X|X}, Signature). The union has a repeated member. Without 1365, LuaUnionMembers::eq says such a union is unequal to itself, so Comparisons::intern never finds its own key, and each read interns a fresh node. That matches gdb: intern → LuaUnionType::eq on top.
    • Check: main + 5294c22 (1365's fix) → 0.14 s on the fixture. 1361 17f9a2e4 + 5294c22 → snacks.nvim finished, 7.32 s CPU (main 7.36 s; outcome, machine loaded).
    • Falsified on the way: the fork's same-declaration branch at the projection site. The fork with main's branch forced in is still fast.
    • Not a flow.rs speedup, so there is nothing new to port. 1361 waits on 1365.

    Fixture (emmylua_check -c /dev/null DIR):

    a.lua

    ---@class G
    ---@field cfg Cfg
    ---@class Cfg
    local M = {}
    function M.layout(opts)
      local layout = M.resolve(opts)
      ---@cast layout X
      if not layout.layout then
        ---@cast layout X|{preview: boolean}
        if layout.preview == false then
        end
      end
      return layout
    end
    ---@generic T
    ---@return T
    function M.resolve(v)
    end

    b.lua

    local layout = G.cfg.layout()

    Load-bearing (each cut makes it fast): the second file's call, the global G class route (a typed local is fast), both casts, the if around the second cast, the generic resolve. X is undeclared. One file is fast.

  7. mareklangiewicz commented on Nov 24, 2026

    @mareklangiewicz
    OwnerAuthor

    Upstream 1367: what its corpus adds on main 48ef52a are (corpus diff up-48ef52a0-1123 up1367-1123, +78 added lines: +60 assign-type-mismatch, +18 inject-field)

    Each added line was looked up in the fork's base run merge-7d6084b4-1120 (same file, line and code; the fork has carried this check since e1b65c9):

    • 51 of 78 are on the fork too. Samples read by hand agree with the annotations: integer slots given a number (gitsigns hunks.lua, max()/min() bounds); table<integer, true> given boolean? (treesitter-context :238); boolean field given boolean? (trouble). The inject-field lines are main's own literal rule, now reached by index writes. Main already flags extra literal keys on a declared assignment, the same as these:

      hit 0.25.1 upstream fork 1367 source
      a.lua:3 inject-field Field 'pid' ✓ ✓ panes[#panes + 1] = { id = "b", pid = 2 } (---@class Pane above it)
      a.lua:7 inject-field Field 'id' ✓ ✓ ✓ one = { id = "c" } (local one ---@type Pane2 + ---@class Pane2 above)

      So sidekick tmux.lua:97, treesitter.lua:183 and opencode.lua:40 are that shape. A ---@class on an assignment statement does not make its literal declare the class, on main or on the fork.

    • 27 of 78 are not on the fork, and come from main's index reads, not from 1367. On main a read through an index signature does not give its value type:

      hit 0.25.1 upstream fork source
      local x = p[1] with ---@param p table<integer, S>, into ---@type integer S no hit S
      active[1] and b and active[1] or nil (---@type table<integer, S>, local active = {}) S? nil S?
      local function g2(w) local scope = active[w]; return scope and b and scope or nil end true? S?

      That is snacks scope.lua:634 (expected snacks.scope.Scope? but found true?). The others in this group have the same found true/(true|…) and table shapes: lazy cache.lua:83, flash state.lua:92, gitsigns log.lua:191, snacks picker/config/init.lua:152, image/terminal.lua:160, util/highlight.lua:520. Main's read bug is upstream issue 1334 (upstream PR 1340, open since 2026-10-31, now CONFLICTING).

    Verdict: the port is faithful. 1367's extra lines on main are 1340's bug showing through, the same way 1361 waits on 1365. Belief, not verified: that all 27 go away with 1340. Only the scope.lua shape was reduced; 1340 was not rebuilt on main.

    Fixtures (scratchpad, will be gone): px67b (class-on-literal), px67e/px67f (index reads).

  8. mareklangiewicz commented on Nov 24, 2026

    @mareklangiewicz
    OwnerAuthor

    Upstream 1364: what its corpus adds on main 48ef52a are (corpus diff up-48ef52a0-1123 up1364-1123 --against v0251-1120; each line also looked up in the fork base merge-7d6084b4-1120)

    • On the fork too (39 lines): 16+2 undefined-field (0.25.1 reports them as well, with an older message wording, which is why the tag says "differs"), 7 preferred-local-alias, 5 need-check-nil, 5 unnecessary-if, plus some param/assign/return-type-mismatch. These are 1364 doing its job: a ---@param on a table-field function now types the body.

    • Not on the fork (19 lines). These are two main bugs that the now-typed param exposes. The fork and an open upstream PR fix each one:

      hit 0.25.1 upstream fork 1364 source
      need-check-nil function 'p:find' may be nil ✓ ✓ ---@param p Missing.Picker (unresolved), p:find()
      need-check-nil c.header may be nil ✓ ✓ ---@field [string] Comp, c.header.name
      1. A member of an unresolved type reads as nil: LazyVim snacks_picker.lua:48-52 (snacks.Picker is not in LazyVim's tree) and sidekick prompt.lua:81 (sidekick.select_prompt.Item: snacks.picker.finder.Item, parent unresolved), plus that line's integer/number param hit. Fork 8f00f19 (A closure param typed by an unresolved name reads fields as nil, so its return mismatches (fork-only; #80 extends it to table literals) #83) = upstream 1451.
      2. A read through an index signature is nullable: diffview file_history/render.lua ×7 (CompStruct's ---@field [integer|string] CompStruct). Same family as 1367's extras, upstream issue 1334 / PR 1340.
    • Removed: 8 unnecessary-if, 5 param-type-mismatch, 3 assign-type-mismatch, all agreeing with 0.25.1.

    Verdict: the port is faithful. The 19 extras go once 1451 and 1340 land. The body still has no corpus section. Add one with these two groups when the branch is pushed (Marek's call). Belief: the 7 diffview lines are 1340's shape: reduced to a fixture, not run with 1340 built.

  9. mareklangiewicz commented on Nov 24, 2026

    @mareklangiewicz
    OwnerAuthor

    Upstream 1359: the suspect adds are main bugs it exposes, plus the bot reply rewritten (corpus diff up-48ef52a0-1123 up1359-1123 --against v0251-1120; each added line looked up in the fork base merge-7d6084b4-1120)

    Suspect adds that are not on the fork. Each reduces to a shape main already gets wrong, without 1359 (1359 only makes more call results known):

    hit 0.25.1 upstream fork 1359 source
    a.lua:2 assign-type-mismatch expected 'nil' but found '1' ✓ ✓ local x = nil / x = 1
    a.lua:15 return-type-mismatch expected 'nil' but found 'std.RawGet<…>' ✓ ✓ an unannotated __index closure whose first return is a nil local
    • treewalker heading.lua:157 (local level = nil, then level = M.get_heading_level_from_node(…)) is the first row. Main treats a bare inferred nil initializer as the local's reassignment contract. The fork fixed this in 3dcb757 ("an inferred nil is no assignment contract", 2026-10-24), which has no upstream PR. It is a small, standalone candidate: a 13-line change in types.rs plus one test. Main flags plain local x = nil; x = 1.
    • telescope make_entry.lua:131 is the second row. The fork reports nothing there; which fork commit fixes it was not identified.
    • nvim-nio streams.lua:84,97 function 'pipe:fileno' may be nil: a member of an unresolved type reads as nil, the same as on 1364 (fork 8f00f19 = upstream 1451).
    • Not read: plenary path.lua:877, mini.icons icons.lua:482, refactoring utils.lua:101, diffview config.lua:93 (also added on 1367's run).
    • The rest of the adds (luarocks inject-field ×24 in snacks' .tests tree, argparse, trouble api.lua:49, …) are on the fork too.

    Bot review (2026-11-04), reply rewritten (the earlier draft was lost). Probe of the review's cases, assign-type-mismatch into ---@type integer:

    case upstream fork 1359
    local a, b = 5, then b no hit no hit no hit
    local a, b = one() (---@return string), then b no hit no hit no hit
    ---@return [string, boolean]..., slot 1 boolean boolean boolean
    same, slot 2 nil nil nil

    Draft reply for 1359 (post when the branch is pushed, Marek's call):

    Thanks. Point by point, against 28ab072:

    1. local a, b = 5 gives b any, not nil. That is deliberate: it is what the flow already gives that local on main, so the declaration and its reads agree. Checked on main 48ef52a and on this branch: ---@type integer local c = b reports nothing on either. Typing it nil would make every later b = x a mismatch, the same way local x = nil makes x = 1 one on main today.
    2. from_name("any"): there is no PrimitiveType::Any. any is a built-in name that the facade lowers to LuaType::Any (facade.rs, "Built-in doc names (any/unknown/...)").
    3. A variadic tuple past its length: ---@return [string, boolean]... gives slot 1 boolean and slot 2 nil, on main and on this branch alike. This PR does not change it.
    4. The expanding-candidate predicate has no other copy in semantic_db/types.rs, so there is nothing to drift from. I can extract it if you prefer a named helper.
    5. Repeat ignoring index is commented now (28ab072).
    6. An empty Multi is skipped like any other candidate with no slot, so the result stays unknown and the caller's any fallback applies.
  10. 7 remaining items

  11. mareklangiewicz commented on Nov 26, 2026

    @mareklangiewicz
    OwnerAuthor

    plenary string|(): root cause and fork fix 29ddf31 (installed, gated; local, NOT pushed)

    Cause (main and fork): need-check-nil reads a call's raw result-list type, so is_nullable misses the nil inside it. Two sites: prefix_type, which also serves #, and check_arithmetic_operand. string|() and (integer?,integer?,string?...) are result lists, not unions with nil. The VM already reads an operand's slot 0 (vm.rs binary/unary operands), and a parenthesized call is projected, which is why (g(1)) + 1 was reported and g(1) + 1 was not.

    shape (g may return nothing) 0.25.1 main 4c18e8e fork b596edb 1472 e7d8170 fork 29ddf31
    g(1):upper() ✓ ✓
    g(1) + 1 / s:find("a") + 1 ✓ ✓
    #g(1) ✓
    (g(1)) + 1 ✓ ✓ ✓ ✓

    Fix: one value_type_at (the slot 0 of a result list, otherwise the type unchanged), used by both sites. Test test_call_that_may_return_nothing_may_be_nil_as_a_value: RED → GREEN (--red-revert=HEAD). All 2290 tests pass, lint passes, the gate passes, and gate all plus nvim dev check emmylua are clean.

    Corpus slot0-dirty-1126 (29ddf31's code) against fork-b596edb6-1126: need-check-nil +110 −0, 70 agree with 0.25.1. The other 40 were read by hand and are all true nils: 37 grug-far get_inst() (0.25.1 reports the same nil plus a function …:help twin), LazyVim io.popen("uname"):read, and nvim-treesitter #string.match(..) ×3.

    Lua-side answer: luagnd ceaf5e4 (assert(io.popen('exit 3')) in spec/lua/gndx/exectree.lua, a true positive).

    Wording, not a bug: plenary filetype.lua:183 (match = filetype.detect_from_modeline(..)) is reported by every build after 0.25.1. Main prints the raw (string|()), and the fork words the same report differently. The assign checker shows the unprojected source. That's cosmetic, so it's not chased.

    Upstream (Marek's call): the index half is a main gap that predates 1472. The arithmetic half sits on 1472's new check. Options: add the fix to 1472 as one more commit, or open a separate PR for the index half.

  12. mareklangiewicz commented on Nov 26, 2026

    @mareklangiewicz
    OwnerAuthor

    Call-result slot 0: shipped (follow-up to 7203338396)

    • Fork: 29ddf31, then 83d4630, both pushed. 83d4630 is installed and gated, and gate all plus nvim dev check emmylua are clean. 83d4630 projects only a call, like both upstream branches. Corpus fork-83d46306-1126 against slot0-dirty-1126 (29ddf31's code): 0 changed lines.
    • Why call-only: on main, projecting a name brought back a guarded local's nil. The case is blink.cmp docs.lua:71-74: local a, b = f() with ---@return number?, number?, then if a ~= nil and b ~= nil (reduced to 13 lines). Plenary job.lua:301,351 and grug-far inputs.lua:505 were the same false hit. The fork's flow didn't show it. The reduction is now a negative case in each branch's test, and it goes red against a mutant that projects names (--red-patch).
    • upstream 1472, a023e2f (pushed, body updated): an arithmetic operand that is a call reads its first result. Corpus nilarith-a023e2f4-1126 against nilarith-e7d81709-1126: need-check-nil +7, all matching 0.25.1, plus the diffview A two-target assign-type-mismatch is reported on either line, run to run #59 flip (±1). 1998 tests pass, lint passes.
    • upstream 1473 (new, draft), branch fix-call-prefix-first-result (worktree callprefix, 6da5477): a call used as a prefix reads its first result (g(1):upper()). Corpus callprefix-6da5477c-1126 against up-4c18e8ef-1126: need-check-nil +53 −0, 49 lines match 0.25.1. Of the rest, LazyVim io.popen and grug-far get_inst() were read and are true; the diffview and gitsigns assign-type-mismatch ±4 are A two-target assign-type-mismatch is reported on either line, run to run #59 flips. 1994 tests pass, lint passes. 1472 and 1473 add the same value_type_at, so the second to merge gets a small conflict.
    • CPU: the corpus runs went 49→59-61 s while other lab work ran (the test logs say LOADED), so the numbers are unreliable. gndx emmylua ab was not run.
    • Lua side: luagnd ceaf5e4 (pushed).
  13. mareklangiewicz commented on Nov 28, 2026

    @mareklangiewicz
    OwnerAuthor

    2026-11-28: 1472 merged, 1473 rebased

    • Upstream merged 1472 (a023e2f) on 2026-11-27 as 6dad986. CI on a023e2f was green.
    • 1473 was rebased onto upstream main 21fd014, giving 6c93aef, and force-pushed. It's still a draft and is now MERGEABLE. It reuses 1472's value_type_at, so the code change is just prefix_type calling it, plus the test. The test fails with that change reverted and passes with it. 2027 + 253 tests pass, lint passes. The PR body was updated for the rebase. The corpus numbers in it were measured before the rebase.
    • Fork marek-main-fixes is 33 behind upstream 21fd014. The next merge meets 1472 in need_check_nil.rs, which overlaps fork 83d4630. To resolve it, keep upstream's helper and re-add the fork's call sites.
  14. mareklangiewicz commented on Dec 5, 2026

    @mareklangiewicz
    OwnerAuthor

    2026-12-05: upstream candidates re-measured on main 2d2374f (all on CI; not pushed, no PR)

    candidate worktree / branch (local) tests corpus vs main
    fork b7af797: a module's own members come before writes from other files fix-module-own-members-first, 97095b9 test RED on main's query.rs, GREEN here (run 47524642767); 3086 pass, lint pass (47524855844) own-97095b92-1205 vs up-2d2374fa-1205: 16 lines; the stable ones: conform health.lua:13 −1, lspconfig configs.lua:74 message flip, sidekick −1/+1 (4 of 5 agree with 0.25.1); the rest is #59 record-order noise. guh.nvim's 34 undefined-field + 2 need-check-nil stay put (main drops them in 1 of 3 runs; 0.25.1 reports them, 30 same-code)
    fork 5fb08c9: workspace files load in path order fix-workspace-load-order, 30a64e2 no test (none on the fork either); 3086 pass, lint pass (47524856296) 3 runs each: main varies on guh.nvim (−34 undefined-field, −2 need-check-nil in run 3), the port never does; both keep #59 assign-type-mismatch moves (diffview, blink, gitsigns, nui, perlls: upstream 1437's class). But vs main: 122 lines (neovim-runtime +65, snacks −41; inject-field +44 −5, param −18), 76 differ from 0.25.1: path order picks a different first-match than ext4's readdir order. Needs reading before any draft
    fork #114 (d0d56f7..a08de2c) none NOT RED on main fork-only; see #114

    Runs: up-2d2374fa-1205{,-2,-3}, order-30a64e2b-1205-{1,2,3}, own-97095b92-1205, v0251-1205.

  15. mareklangiewicz commented on Dec 5, 2026

    @mareklangiewicz
    OwnerAuthor

    2026-12-05: upstream 1512 opened as a draft: branch fix-module-own-members-first (97095b9, fork b7af797 on main 2d2374f), measured in the comment above. Ready-or-hold: Marek's call.

  16. mareklangiewicz commented on Dec 5, 2026

    @mareklangiewicz
    OwnerAuthor

    2026-12-05: fork 5fb08c9 (path-order load) alone is NOT an upstream candidate: held.

    Its 122 lines against main 2d2374f (order-30a64e2b-1205-1 vs up-2d2374fa-1205, --against v0251-1205) are a different first-match, not a better one:

    • neovim-runtime +65 (inject-field 44, need-check-nil 16), 0 of 65 agree with 0.25.1: false hits. vim.bo / vim.wo have two definitions: lua/vim/_core/options.lua:257 vim.bo = new_buf_opt_accessor() (unannotated) and lua/vim/_meta/options.gen.lua:9 (---@class vim.bo, vim.bo = vim.bo). Path order loads _core before _meta, so the accessor wins the first match: vim.bo.commentstring = … becomes inject-field (ftplugin/*.lua, man.lua, defaults.lua), vim.wo[0] may-be-nil. The runners' readdir order happened to put _meta first.
    • snacks.nvim −41, 35 agree with 0.25.1: there path order happens to pick the better definition.
    • The fork has 5fb08c9 and none of the 65 (gate-5fb08c9a-1204, gate-a08de2cf-1205: 0 on ftplugin/arduino.lua:1, checkhealth.lua:2, man.lua:424), so another fork rule picks the annotated definition there. Which one is unidentified.
    • What it fixed upstream, guh.nvim's run-to-run flip, upstream 1512 fixes on its own. The rest of main's run-to-run noise is record-field order (upstream 1437's class).

    Determinism by path is only worth proposing together with a rule for which definition wins (an annotated or @class definition over a plain assignment), the rule the fork apparently already has. Branch fix-workspace-load-order (30a64e2) kept locally, not pushed.

  17. mareklangiewicz commented on Dec 5, 2026

    @mareklangiewicz
    OwnerAuthor

    2026-12-05: the vim.bo rule behind the held 5fb08c9; plus a new candidate (fork 1b6a754)

    Reduced from neovim-runtime (reduce --bin=upstream --unless-bin=fork, 168 files → 3), with the meta file's own field write restored so the hit is false, not merely unannotated:

    -- lua/vim/_meta.lua
    ---@meta
    vim = {}
    ---@class vim.o
    vim.o = {}
    -- lua/vim/_core/options.lua
    --- @return vim.bo
    local function new_buf_opt_accessor(bufnr) end
    vim.bo = new_buf_opt_accessor()
    -- lua/vim/_meta/options.gen.lua
    --- @meta _
    ---@class vim.bo
    vim.bo = vim.bo
    --- @type string
    vim.o.commentstring = ""
    vim.bo.commentstring = vim.o.commentstring
    -- ftplugin/arduino.lua
    vim.bo.commentstring = '// %s'   -- inject-field on upstream 2d2374fa; not on 0.25.1 or fork 3d519d1d
    • --type-of vim.bo is vim.bo on upstream and fork alike: the fork's difference is in the inject-field decision, not the type.
    • In the full runtime/lua + one ftplugin (168 files), upstream main reports it locally too: it depends on file order on main itself, not only with 5fb08c9.
    • Not fork 1b6a754 (ported as fix-global-class-table-members 802126e: still reports every vim.bo/vim.wo/vim.v write). Which fork commit is unidentified; finding it needs a bisect with a build per step.

    New upstream candidate: fork 1b6a754 (check_field: a global class table's own assignments are not injections), branch fix-global-class-table-members 802126e on main 2d2374f (two small conflicts; def.id for the fork's target_id; the LuaMemberKey import). Both tests RED on main's check_field.rs, GREEN here (--red-at); CI build + lint pass. Upstream main reports package.path = "./?.lua;" .. package.path as inject-field (Fields cannot be injected into the reference of packagelib for path); the port and the fork do not. Corpus leg not run yet. Not pushed.

  18. mareklangiewicz commented on Dec 5, 2026

    @mareklangiewicz
    OwnerAuthor

    2026-12-05: the vim.bo rule is fork 229756f (found by the new remote bisect)

    gndx emmylua bisect hit 56267ead 3d519d1d <the vim.bo fixture above> --code=inject-field --file=ftplugin/arduino.lua --line=1: the fork's 411 first-parent commits in 10 probes, on one runner (run 47530684023; the fixture listed in path order there). First commit without the hit: 229756f "A meta file's ---@class a.b on a.b = v makes the global path a.b the class surface" (2026-10-30; gate then: 48 hits removed, 0 added). Confirmed alone: 229756fc^..229756fc, run 47531590279.

    So 5fb08c9 (path-order load) is an upstream candidate only together with 229756f: path order makes _core/options.lua win the first match, and 229756f is what keeps vim.bo/vim.wo/vim.v fields from reading as injections whichever file wins. Next: port 229756f onto main 2d2374f, red/green, corpus alone and with 5fb08c9.

  19. mareklangiewicz commented on Dec 5, 2026

    @mareklangiewicz
    OwnerAuthor

    2026-12-05: fork 229756f ported onto main 2d2374f: branch fix-meta-dotted-class-path b22d95c (local, not pushed)

    • Port by git diff | git apply -3. Trap met: rerere replayed the fork merge's resolution of inject_field_test.rs, which flipped upstream's test_record_fields_distinguish_optional_and_required_values to the fork's expectation (AssignTypeMismatch ×2 for upstream's ParamTypeMismatch ×2). The CI round caught it (run 47533534902). Fixed by taking upstream's file and adding only the new test (git rerere forget on that path also dropped the cached fork resolution).
    • The fork's test (vim.bo[3].filetype in a function) is RED on both sides on main: main reports nothing there. Replaced by the reduced neovim-runtime fixture (ftplugin/arduino.lua + _core/options.lua + _meta/options.gen.lua + _meta.lua), both load orders, control b.zzz = 1 on a ---@param b vim.bo. A top-level vim.bo.zzz = 1 is not a usable control: with the global path as the class surface, that write itself declares zzz (as for any global table).
    • test --ci --red-at=origin/main:…/facts.rs,…/query.rs: RED → GREEN (run 47533370129; red: commentstring ×2 + zzz, green: zzz only).
    • ci: build, 3086 tests, lint PASS (run 47534035381).
    • Corpus alone port-b22d95c1-1205 vs up-2d2374fa-1205 --against v0251-1205: 56748 → 56675. neovim-runtime −36, all agree with 0.25.1 (tohtml.lua vim.wo/vim.bo reads, defaults.lua:630/633). The 5 added lines (blink.cmp, diffview, gitsigns compat.lua:144, nui) are main's own run-to-run noise: each appears in ci-up-2d2374fa-1204 or main's reruns -2/-3. guh.nvim −35 is the known file-order flip. No added hit. Upstream candidate on its own.
    • Stacked on 5fb08c9 (fix-load-order-meta-class 3c95321; ci PASS, 3087 tests, run 47534398604), corpus stack-3c953217-1205:
      • vs order-30a64e2b-1205-1: −88, 92 agree with 0.25.1; all 44 inject-field gone.
      • vs main: +15 need-check-nil vim.wo[0] may be nil remain (ftplugin/checkhealth.lua:1–6, lua.lua:6, defaults.lua:733–745, exmode.lua:107), plus lsp/handlers.lua:481 undefined-field [ctx.bufnr]. 0.25.1 reports none of them. So 229756f is not the whole rule: another fork commit keeps vim.wo[0] non-nil. Next: reduce checkhealth.lua:1 (--bin=stack --unless-bin=fork) and bisect hit it like the vim.bo one.
  20. mareklangiewicz commented on Dec 5, 2026

    @mareklangiewicz
    OwnerAuthor

    2026-12-05: the vim.wo[0] may be nil rule is upstream PR 1340; the package.path candidate's corpus is clean

    vim.wo[0] (the 15 need-check-nil left on the stack): reduced from neovim-runtime (168 files → 2, then the meta side restored by hand so the hit is false):

    -- ftplugin/checkhealth.lua
    vim.wo[0][0].wrap = true   -- need-check-nil `vim.wo[0] may be nil`: upstream, port, stack; not 0.25.1, not fork 3d519d1d
    -- lua/vim/_core/options.lua
    --- @return vim.wo
    local function new_win_opt_accessor(winid, bufnr) end
    vim.wo = new_win_opt_accessor()
    -- lua/vim/_meta/options.gen.lua
    --- @meta _
    ---@class vim.wo
    ---@field [integer] vim.wo
    vim.wo = vim.wo
    --- @type boolean
    vim.wo.wrap = true
    -- lua/vim/_meta.lua
    ---@meta
    vim = {}

    bisect hit 56267ead 3d519d1d … --code=need-check-nil --file=ftplugin/checkhealth.lua --line=1 (run 47535346030, 10 probes): first fork commit without it is merge 44cbca5 fix-string-table-index-1334, i.e. fork c347458 "index signature reads have the value type", which is upstream PR 1340 (open, ready, mergeable on main).

    Check: scratch branch scratch-stack3-1205 b21330c = 5fb08c9 + 229756f port + merge of 1340's head 6911ca1 (clean merge, rerere off). The fixture is clean there, and corpus stack3-b21330ca-1205 vs main has 0 vim.wo[0] lines. The whole diff (869 lines) is mostly 1340's own effect, so it is no verdict on the stack.

    So: 5fb08c9 stays held until 1340 lands upstream (or goes up stacked on it). 229756f's port stands alone (previous comment: no added hit).

    package.path candidate fix-global-class-table-members 802126e, corpus pkgpath-802126e8-1205 vs up-2d2374fa-1205 --against v0251-1205: 56748 → 56698. inject-field −13 (packagelib path/cpath: async.nvim, blink.cmp ×3, catppuccin, gitsigns ×4, lazy.nvim ×3, nui), undefined-field −34 (guh, the known flip), all agree with 0.25.1. The +5 are the same noise lines as the port's (blink sources.lua:76/81, diffview config.lua:91/336, nui init.lua:239). No added hit. Upstream candidate.

  21. mareklangiewicz commented on Dec 5, 2026

    @mareklangiewicz
    OwnerAuthor

    2026-12-05: drafts opened (Marek's go-ahead): upstream 1514 (fix-meta-dotted-class-path b22d95c, fork 229756f) and upstream 1515 (fix-global-class-table-members 802126e, fork 1b6a754). Both branches pushed to marek. Held: 5fb08c9 (fix-load-order-meta-class 3c95321, local), waiting for upstream 1340. Also pushed: myvi 558c5e2, marek-main-fixes f41f34f.

  22. mareklangiewicz commented on Dec 5, 2026

    @mareklangiewicz
    OwnerAuthor

    2026-12-05: upstream 1340 audited alone on main 2d2374f; two fork flow rules ported (local, not pushed)

    Scratch merge of 1340's head 6911ca1 onto main 2d2374f (worktree audit1340, 4b6e2ba; CI build). Corpus pr1340-4b6e2ba5-1205 vs up-2d2374fa-1205 --against v0251-1205 --noise=up-2d2374fa-1205 --also=gate-a08de2cf-1205: 56748 → 56783, 765 changed lines, 474 agree with 0.25.1. 418 added lines; 179 not reported by 0.25.1; 100 reported by neither 0.25.1 nor the fork (gate-a08de2cf-1205). Those 100 are what a maintainer would meet. They fall into classes that main gets wrong and that 1340's typed reads expose:

    class lines fix after
    a guard or write on t[k] (variable key) does not narrow: if cache[b] then cache[b].x, timers[id] = timers[id] or …; timers[id]:start() (gitsigns, grug-far, lualine, neovim-runtime pack/highlighter, …) 29 fork cd052a7 + 6ccc474, ported (below) 100 → 71
    a member of an undeclared type reads nil: function 'timer:is_closing' may be nil, hl.parser:destroy, scope.inside[1]:start (uv/TSNode undeclared in the empty-config corpus) 16 upstream 1451 71 → 55
    a new key on an annotated table literal is checked against the literal's shape: refactoring config.lua ×19 expected 'function' but found '(fun(…))?' (---@type field {[string]: nil|fun(…)}; main also reports undefined-field c there, upstream 1341's case) 19 fork 0883e61 (annotated literal reads as its annotation); no upstream PR open
    local x = nil makes nil the contract (nui tree ×3, grug-far sync.lua:49, lsp/handlers.lua:66) 5 fork 3dcb757; no upstream PR open
    a member read through a nullable union reported found nil for a param that accepts nil (lazy cache.lua:510/512 expected any, guh) ~5 upstream 1423 not measured stacked
    rest (unnecessary-if/assert ×10, nvim-lint call-non-callable, …) ~26 unread

    Fixture for the first class (probe: 0.25.1 ✗, main ✗, fork ✗, 1340 merge ✓ on lines 10 and 17; all four report line 22):

    ---@type table<integer, E?>
    local cache = {}
    local function guarded(b) if cache[b] then print(cache[b].name) end end   -- :10
    local function written(b) cache[b] = cache[b] or { name = "x" }; print(cache[b].name) end   -- :17
    local function plain(b) print(cache[b].name) end   -- :22, true positive

    Ports (local branches, not pushed):

    • fix-dynamic-index-guard 645b060 = fork cd052a7 on main 2d2374f (a dynamic index guard holds when its key is a stable path or a length). Conflicts: main's narrow_index_condition now takes Option<&LuaExpr> and a matches_target closure, and has a second caller in flow/receiver.rs (passes a literal-key IndexTarget). test --ci --red-at=origin/main:flow.rs,flow/receiver.rs: RED → GREEN (2 of 3; the third asserts a lost guard still reports). CI build, 3088 tests, lint PASS (run 47545591635). Corpus alone guard-645b0609-1205 vs main: 56748 → 56633, need-check-nil −58, param −22, 74 of 80 removed lines agree with 0.25.1; +3: diffview config.lua:341 (same-code on 0.25.1), gitsigns compat.lua:144 (main's known noise line), snacks profiler/tracer.lua:23 expected integer but found number (unmasked: the read was nil before; trace.depth = 0 types the field integer, the class says number). A standalone upstream candidate, independent of 1340 (arrays T[] already read T? on main).
    • fix-dynamic-key-write-settles c81a9f4a (on 645b060) = fork 6ccc474 (a write to t[k] settles a later t[k] read). Its test is NOT RED on main alone: the table<string, V?> read is untyped there. It belongs on 1340's branch, as 1340's follow-up.

    Stacks: 1340 + both ports (audit1340 1d5a8f1): RED → GREEN for the write test, CI 3093 tests + lint PASS (run 47545943222); corpus stack1340-1d5a8f11-1205: 56748 → 56649, not-on-fork-nor-0.25.1 adds 100 → 71. Plus 1451's head d5616bb (one vm.rs conflict: 1340's index-signature block, then 1451's missing_member_is_known; e7ac337): corpus stack4-e7ac3375-1205 56748 → 52917, 4233 of 4488 lines agree, adds 71 → 55.

    Verdict: 1340 alone puts ~100 false hits in front of a maintainer, none of them 1340's own rule being wrong: each reads a now-typed value through a main gap. Suggested order upstream (Marek's call): the guard port first (standalone, clean), 1451 and 1423 (ready), then 1340 with the write-settles commit added to its branch. The refactoring ×19 (fork 0883e61) and nil-initializer ×5 (fork 3dcb757) have no upstream PR yet; ~26 lines are unread.

  23. mareklangiewicz commented on Dec 5, 2026

    @mareklangiewicz
    OwnerAuthor

    2026-12-05: the 20 ready upstream PRs ranked for a merge-order note (data only; whether to post anything upstream is Marek's call)

    Order: crashes and slowdowns first (Marek's rule), then large clean corpus wins, then small or editor-only, then those that need another PR first. "Behind" = commits of main 2d2374f the PR head lacks (git rev-list --count HEAD..origin/main, today). Corpus numbers are from the comment or table row named; most predate main 2d2374f.

    # PR what effect (as measured) size behind
    1 1371 binding mentioning a bound generic stays out of the solver mason.nvim OOM fixed +36/−3 0
    2 1370 closure param evaluation inherits the cycle guard tuis.nvim stack overflow (still crashes on main 2d2374f's corpus run) +45/−2 198
    3 1458 name-keyed member use reads the by-name bucket perf; test times out (5 s) on main +86/−1 0
    4 1451 member missing from an unresolved type is unknown, not nil −2866 (48ef52a) +101/−13 0
    5 1423 missing union member is nil only for a param rejecting nil −226 param, all agree with 0.25.1 (48ef52a) +41/−0 45
    6 1362 @overload makes a class callable −114 call-non-callable, all agree (48ef52a) +109/−8 0
    7 1447 member read before its write starts from the declared field fork #41: 146 false hits; no main-corpus number on record +253/−5 0
    8 1448 argument minimum = last required param's position +8 true, −25 false (obsidian) +37/−3 45
    9 1437 record literal's first mismatching field is stable main varies on 16 lines, this on 5 (4 runs) +55/−1 0
    10 1450 enum/named key fits a table of its base type neovim-runtime only +207/−39 45
    11 1368 global member's ---@type holds in every file no corpus change +73/−1 45
    12 1449 attribute overload arity no corpus change +43/−19 45
    13 1355 duplicate-set-field ignores a nil module field half superseded; not re-measured +62/−11 0
    14 1337 closure __index with a guarded return partly superseded; not re-measured +133/−2 0
    15 1338 Partial<T> fields keep T's docs editor (docs) +137/−3 0
    16 1335 hover: field docs through a union editor (hover) +78/−1 0
    17 1341 undefined-field accepts keys matching an object index signature not measured on a recent main +36/−1 230
    18 1353 call to another file's member closure returns its signature not measured on a recent main +194/−3 204
    19 1359 local a, b = f(): each target its own slot −53 net, 74 of 95 agree (4c18e8e); its adds are main's nil-initializer contract (fork 3dcb757) and 1451's class +207/−1 36
    20 1340 index signature reads have the value type alone: ~100 false hits from main gaps (comment above); needs the guard port, 1451, 1423, and the write-settles commit +171/−1 36
    • Before any ping: merge main into 1370, 1341 and 1353 (around 200 behind each) and re-measure them; the five at 45 behind (1368, 1423, 1448, 1449, 1450) need only a merge. 1340 and 1359 are 36 behind and mergeable.
    • Not in the 20: a new candidate from the 1340 audit, local fix-dynamic-index-guard 645b060 (−115 on main, no added hit of its own); it would rank near Lab: gndx emmylua test runs cargo fmt --check; dirty-tree lint says "commit, then re-lint" #5.
    • Drafts (1361, 1364, 1367, 1465, 1471, 1473, 1512, 1514, 1515) are left out; 1361 and 1367 wait on 1340.
  24. mareklangiewicz commented on Dec 5, 2026

    @mareklangiewicz
    OwnerAuthor

    2026-12-05: upstream 1517 opened as a draft; 1340 stacked on it (Marek's go-ahead). 1517 = fix-dynamic-index-guard 645b060 (fork cd052a7). 1340's branch: 645b060 merged in (8ae9045, brings main 2d2374f), then the write-settles port df4bcc3 (fork 6ccc474), pushed; its tree equals the audited stack 1d5a8f1; test --ci --red-at=645b0609:flow.rs,flow/guards.rs,flow/array.rs RED → GREEN on df4bcc3; body gained a "Stacked on EmmyLuaLs#1517" section. Lab (myvi 2d645b6): a --ci red tree is a throwaway worktree of its own, so red runs started together no longer meet in bisect; a --red-at red tree that does not build names the branch's other changed source files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions