Repository navigation
perf: build no SpellXSpellVisual hotfix records a client is never told about - #595
Conversation
…d about From 3.4.3 on, SMSG_AVAILABLE_HOTFIXES advertises four tables, and SpellXSpellVisual is not one of them. Its loader still turned every CSV row into a HotfixRecord that nothing could send: 33,466 on 3.4.3 and 46,939 on 4.4.2. The two lookups it fills, SpellVisuals and SpellXSpellVisualToSpellVisual, are what the proxy actually reads. The advertised set moves out of WorldSocket into AdvertisedHotfixTables, so the packet and the loaders read the same decision. The loader keeps filling both lookups on every build and only builds records when its table is advertised; 1.14 and 2.5 builds, which advertise everything they load, are unchanged. ItemEffect is not advertised either but stays loaded: its CSV records get ids at HotfixItemEffectBegin, inside the range UpdateHotfix searches, and GenerateHotFixMessage sends them without consulting the filter. GameData.LoadEverything, records built / bytes allocated: 3.4.3 58,257 -> 24,791 135 MB -> 119 MB 4.4.2 63,765 -> 16,826 166 MB -> 143 MB Part of Xian55#187.
GameData.SpellVisuals was assigned by two loaders running in parallel: LoadSpellVisuals in LoadEverything (the SpellVisuals CSV) and the SpellXSpellVisual hotfix loader inside LoadHotfixes, which copies the field, lays its rows over the copy and assigns it back. Whichever finished last won. On 3.4.3 and 4.4.2 the two files hold the same map, so it never showed. On 1.14 they differ: the hotfix file names three spells the base file does not have. A Release build lost those three rows on every start (30 of 30). A Debug test host ended with only the three rows, and none of the 14,232 base rows, in 15 of 36 starts. One job now reads both files in order and is the only writer of the field. It stays among the hotfix jobs because it writes the hotfix records. ReadSpellVisuals is the pure part, for tests. After: 1.14 loads 14,235 rows in 30 of 30 Release starts and 36 of 36 Debug starts. Records, lookups and load time on 2.5, 3.4.3 and 4.4.2 are unchanged. Co-Authored-By: Claude <noreply@anthropic.com>
|
Thanks for this. I reviewed and measured it locally and pushed one commit on top, cdc9b98. Here is why. Your commitIt does what the description says. Against
Every record outside What the extra commit fixesWhile comparing the lookups I found a race that is already on
Whichever finished last won. On 3.4.3 and 4.4.2 both files hold the same map, so it never shows. On 1.14 they differ: the hotfix file names three spells the base file does not have.
"Hotfix rows only" means a map of 3 entries, with none of the 14,232 base rows. I only saw that in the Debug test host, not in a Release build. Your change did not cause any of this, but making the hotfix loader faster moved the odds in that host, which is how it came up. The fix: one job reads both files in order and is the only writer of the field. Records, lookups and load time on 2.5.3, 3.4.3 and 4.4.2 are the same as with your commit alone. The suite is at 4,773 passed, 35 skipped, 0 failed. One correction to the description"1.14 and 2.5 are unchanged" now holds for the hotfix records only. On 1.14 the three rows of |
No release for this merge yet: GitHub has no macOS runner for usThe merge is on master (a6e8e87), but the release that normally follows it has not been published. The latest release is still v4.7.7. Nothing is wrong with the change itself. What is failing. Both workflows the merge started stop at the same job, the macOS build:
The macOS job never starts. It waits about 15 minutes for a hosted runner and GitHub then cancels it with:
In the Release workflow the What has been tried. The failed jobs have been rerun 10 times between 15:33 and 18:08 UTC on 2026-11-19, each with the same result. The run on the contributor's fork was cancelled the same way, so it is not tied to this repository. The workflows still ask for What happens next. The reruns continue. As soon as a macOS runner picks the job up, the Release workflow goes on by itself and publishes the version that contains this PR. No action is needed from anyone here. |
|
Update: the release went out. On the 13th attempt of the Release run, a macOS runner picked up the job at 18:44 UTC on 2026-11-19, and the workflow then finished by itself. v4.7.8 is built from a6e8e87 and contains this PR, with all four platform builds and the container image. Nothing more is needed. |
Part of #187.
What
From 3.4.3 on,
SMSG_AVAILABLE_HOTFIXESadvertises onlyAreaTrigger,ItemExtendedCost,CurrencyTypesandGlobalStrings.LoadSpellXSpellVisualHotfixesstill turned every CSV row into aHotfixRecordthat nothing could send. Its real output is the two lookups,SpellVisualsandSpellXSpellVisualToSpellVisual.WorldSocket.SendAvailableHotfixesintoAdvertisedHotfixTables, so the packet and the loaders read the same decision.LoadSpellXSpellVisualHotfixesstill fills both lookups on every build, but only builds records when its table is advertised. When it doesn't, the record columns are not parsed either.Measured
GameData.LoadEverything(), Debug build, records left inGameData.Hotfixesand bytes allocated during the load:A smaller store also makes
FindHotfixesByRecordIdAndTablecheaper, since it walks every record and the item-query path calls it twice per hotfix.Why
ItemEffectis not in this PRThe issue lists
ItemEffectas unreachable too, but on currentmasterit isn't.LoadItemEffectHotfixesnumbers its records fromHotfixItemEffectBegin(2,500,000), which is inside the rangeUpdateHotfixsearches fromHotfixItemBegin(2,100,000). So a runtime item record with the same id overwrites the CSV record in place, andGenerateHotFixMessagesendsItemEffectrecords inSMSG_HOTFIX_MESSAGEwithout consulting the filter. Dropping them could change which records reach the client for item tooltips, so I left them alone and noted this in theAdvertisedHotfixTablesremarks. The rest of #187 is still open because of this.Tests
AdvertisedHotfixTablesTests(15 cases): the advertised set per build, andParseSpellXSpellVisualagainst the shipped 1.14, 3.4.3 and 4.4.2 CSVs. With records off it yields identical lookups. With records on it yields one record per row with the same hotfix ids as before. Loading goes through a pureParseSpellXSpellVisual, followingParseAreaTriggerProximity, so tests don't touch the global stores.docs/opcode-coverage.mdis regenerated: its one version-check site moved fromWorldSocket.cstoAdvertisedHotfixTables.cs.dotnet build: 0 warnings.dotnet test: 4,763 passed, 37 skipped, 0 failed.Not play-tested in a client. The only behaviour change is to records no client is told about.