Skip to content

modules — multiplayer 2/2: sharing v2 — expressed through the mode grammar - #8463

Closed
keithharvey wants to merge 2 commits into
modesfrom
sharing-v2
Closed

modules — multiplayer 2/2: sharing v2 — expressed through the mode grammar#8463
keithharvey wants to merge 2 commits into
modesfrom
sharing-v2

Conversation

@keithharvey

@keithharvey keithharvey commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Sharing, re-expressed on the module stack (base: modes — review this diff only). Feature tracking: #8412 (QA history, required Chobby/engine/teiserver PRs, design links). Supersedes #8408 and the 7-PR sharing chain (#8125#8095).

One squash, deliberately: the original commit tail replayed onto the mode grammar and de-noised (~44% of insertions and ~82% of deletions were stylua reformat of files master doesn't format; removed by token-level splice, gated on lexer token-stream equality).

  • Sharing as a modulemodules/sharing/ owns its lib, economy boundary, policies, gadgets, widgets, policy views, specs, and types; the sharing modes (Disabled, Enabled, Easy Tax, Tech Core, Customize) are mode-grammar chains over sharing's own nouns and serializers. Spec discovery is generic (modules/*/spec), and the mode-infrastructure export widget lives in modules/modes.
  • Found in the squash — gui_chat failed to load in-game at exactly the engine's 200-local ceiling; the half-finished state-table refactor is now finished (200 → 170 main-chunk locals, 741 use-sites, byte-exact reverse-map verified). The modoptions spec invariant is rewritten: module fragments are the list's tail, exactly once.

Where the diff goes (13,181+ / 2,578−)

area +
modules/sharing — lib, economy, policies, modes, types 3,840 0 new module code
test suite 3,620 157 modules/sharing/spec, luaui/Tests/sharing, spec builders
modules/sharing/gadgets 1,367 0 absorbs 6 root gadgets, deleted in the row below (−563)
Tech Core content — units, scripts, defs 1,140 0 keystone / voussoir
carried files — widgets, gadgets, configs 2,250 2,320 net −70; includes the 6 replaced gadgets (−563)
tech points RmlUi widget 464 0
CI, startscripts, i18n, modoptions, misc 500 101

Feature code without the test suite: 9,561+.

The carried-file column is mostly two things. gui_chat is the 200-local ceiling fix — the main chunk sat at exactly LUAI_MAXVARS, so sharing's additions could not load — and it is commit 1 of 2 here, separable and also open standalone against master as #8467; when that lands this PR rebases and the ~530-line mechanical diff leaves entirely. Sharing's own chat footprint is 172+/108−. gui_advplayerslist (376+/598−, net −222) is the m_* block extracted into gui_advplayerslist_modules.lua (+212).

Formatting noise was measured, not assumed: hunk-level token comparison (normalizing whitespace, quote style, trailing commas, ['x']x) across every modified Lua file leaves under ~100 lines of pure reformat; the 42 files relocated into modules/sharing/ are line-for-line identical to their originals; and running stylua over the new module files would add ~1,000 lines, so nothing here is formatter inflation.

Audit trail with per-file noise numbers and flagged follow-ups: bar-design-docs/sharing_tab/sharing_squash_audit.md. Specs: 397/0.

@github-actions

github-actions Bot commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Integration Test Results

19 tests  +4   7 ✅ ±0   15s ⏱️ ±0s
 1 suites ±0   8 💤 ±0 
 1 files   ±0   4 ❌ +4 

For more details on these failures, see this check.

Results for commit e3bd7f9. ± Comparison against base commit 077df5f.

♻️ This comment has been updated with latest results.

The main chunk sat at exactly 200 locals — Lua's LUAI_MAXVARS — so the next
local anywhere in it fails the load. The state table already existed with
every field; the aliases unpacked 30 of them straight back into locals.
Drop the alias block and reference state.* directly: 734 sites, 200 -> 170
locals. Token-for-token identical to the original once the aliases are
folded in, so behavior is unchanged.
@keithharvey

Copy link
Copy Markdown
Collaborator Author

Superseded by the twelve-stage stack starting at #8473: the same work re-cut by domain with foundations first, one commit per PR.

@keithharvey
keithharvey deleted the sharing-v2 branch July 27, 2026 04:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant