Repository navigation
One more Map::Units function at 100%: UpdateSiegeTent - #473
Merged
Merged
Conversation
Units::UpdateSiegeTent, from Gynt's draft on sourcehold's reimpl/map-units-updatefunctions (his draft PR 204; the file's commits there: 609ef6d, the 69.44% import, then his 2fe31a8, 8d684a9 at 69.44%, 974c32f's clang-format, and c933f79, his PR 286 merged into that branch, which took this file's body from reimpl/Wilps-2026-10-18). It reads a true 100.0 / 100.0. The statements are his; what the text needed is where two of them stand. 1. The ULS_TRANSITIONING store stands in front of the `fixedRng & 2` test, as in the original (0x005307FA, the test at 0x00530803). The draft wrote it in both arms so that the type stays a branch, and the compiler then placed the merged store behind the test. Written once in front of the if, the type becomes a branch-free select (sbb) unless the arms hold more than the one store: so the state_2 store, behind the keep reads in the draft, is written in both arms behind the type store. The compiler merges the two copies into the one store behind the join (0x0053082C) and keeps the branches (0x0053080B / 0x00530816). 2. The names of this tree: field_0x3bc; the keep's entry as playerDataArray[1].buildingEntryInfos[BEIE_KEEP] (yEntry 0x0115F888 and xEntry 0x0115F884 are read in that order, hence the two locals); state_2's 6 as US_FIRE_WEAPONUnk (changeUnitType, 0x0053E6C0, copies state_2 into the new engine's state). 3. The `frame >= 4` test after `& 3` is never true, but the original compares and stores it (0x005307D1), so it stays, with a fixme comment; `(fixedRng + 1) & 3` in parentheses, `animationCycleNumber++`, const locals. Measured with real builds of the units stack's head 6e3de74062 (the headers this file includes are the same there as on main 0e4a83b; its one callee, calculatePreferredRelativeOrientation, is reimplemented in neither), the whole build list plus this file and its /GL line, BUILD_OK each: UpdateSiegeTent 100.0 raw / 100.0 normalised, no diff entry, 345 functions; none of the other 344 reads differently. The text before the review's text fixes (the two enum names, the comments, const locals) read the same. Co-authored-by: Gynt <gynt@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The only conflict was the end of cmake/compiler-flags-gl.txt, where both sides added lines; both are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The only conflict was the end of cmake/compiler-flags-gl.txt, where both sides added lines; both are kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gynt
previously approved these changes
Nov 24, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to a conflict with the base branch
Nov 24, 2026
gynt
pushed a commit
to kotijekriv/OpenSHC
that referenced
this pull request
Nov 24, 2026
…old#416, sourcehold#433 and sourcehold#438 (sourcehold#491) sourcehold#416, sourcehold#433 and sourcehold#438 put six callers on cmake/compiler-flags-gl.txt after sourcehold#398 without an entry here: InGameMenu's MenuItemRenderFunction_InGameMenu_MainButtons and Roundtable's MenuItemActionHandler_Roundtable_Main (sourcehold#416), UpdateGhost (sourcehold#416), UpdateFireWatch and UpdateHunterDog (sourcehold#433), and UpdateCageDog (sourcehold#438). Each gets an entry at its address, its callees in address order. The /GL lines stay as they are. Each edge is measured as sourcehold#398's were: the caller's file compiled with the callee files in its unit, against the caller alone, quick_diff on main 7c2e4d6 with every function resolver that has a .cpp and every struct resolver on. The callees tried are the caller's /GL-listed callees below its address. A callee is listed when it raises the caller's ratio on its own, or when leaving it out of the full set lowers it; the listed set reads what the full set reads. - MainButtons: 0.8217 alone, 1.0000 with ButtonGmData::getPictureNumberInGm. - Roundtable_Main: 0.9391 alone, 0.9984 with GameSynchronyState::isAIPlayer. - UpdateFireWatch: 0.3834 alone, 0.9980 with checkIfCitizenUnitIsAliveBasedOnState and hasUnitReachedDestination, the same as with all four of its /GL callees; leaving one of the four out reads 0.7178 (checkIfCitizenUnitIsAliveBasedOnState) and 0.6606 (hasUnitReachedDestination). makeUnitStopWalkingByClearingPathProgressState and commitUnitLocation change nothing. - UpdateGhost: 0.5214 alone, 0.9712 with hasUnitReachedDestination. makeUnitStopWalkingByClearingPathProgressState changes nothing. - UpdateHunterDog: 0.3336 alone, 1.0000 with its four callees and with all five of its /GL callees; leaving one of the five out reads 0.9944 (makeUnitStopWalkingByClearingPathProgressState), 0.7283 (checkIfCitizenUnitIsAliveBasedOnState), 0.9298 (hasUnitReachedDestination), 0.9114 (hasTunnelerNotFinishedDigging). resumeMovementIfNoAttackTarget changes nothing. - UpdateCageDog: 0.2829 alone, 1.0000 with its four callees and with all seven of its /GL callees; leaving one of the seven out reads 0.8651 (makeUnitStopWalkingByClearingPathProgressState), 0.7162 (checkIfCitizenUnitIsAliveBasedOnState), 0.4142 (hasUnitReachedDestination), 0.9949 (tryAttackUnitID, which sourcehold#438 added to the /GL list for it). buildingIsAccessible, resumeMovementIfNoAttackTarget and commitUnitLocation change nothing. sourcehold#473 and sourcehold#475 put UpdateSiegeTent and UpdateHorseArcher_DoShooting on the /GL list; neither calls a /GL-listed function, so neither gets an entry. UpdateHorseArcher calls UpdateHorseArcher_DoShooting, which sits below it, but reads worse with its body (0.9929 with hasUnitReachedDestination, 0.9906 with both), so its entry stays as it is. With every .cpp of main as the build list, cmake/function-visibility-units.py now makes 24 units holding 116 source files (108 before): the six callers, tryAttackUnitID and makeUnitStopWalkingByClearingPathProgressState join the existing groups. No internal names clash, and the 13 names it skips are the ones it skipped before. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One more function at 100%, with no header changes.
Units::UpdateSiegeTentis from gynt's units branchreimpl/map-units-updatefunctions(his draft #204; his #286, merged into that branch as c933f79, took thisfile's body from
reimpl/Wilps-2026-10-18), and the commit credits him as co-author.Units::UpdateSiegeTent/GLWhat got it to 100%. One store moved and one written twice:
ULS_TRANSITIONINGstore stands in front of thefixedRng & 2test, as in the original (0x005307FA). Thedraft wrote it in both arms, so the merged store landed behind the test.
sbb): so thestate_2store(
US_FIRE_WEAPONUnk) is written in both arms behind the type store. The compiler merges the two copies into onestore behind the join (0x0053082C) and keeps the original's branches (0x0053080B / 0x00530816).
frame >= 4test after& 3can never be true, but the original compares and stores it (0x005307D1): itstays, with a
fixme:comment.buildingEntryInfos[BEIE_KEEP]for the keep's entry (y is read before x, hence the two locals).field_0x3bchas no better name in this tree; in gynt's catapult, ballista and fire-ballista drafts it is set to-40 .. -200 and counted up before firing, so it is probably the siege engines' reload cooldown (reset here so a
new engine can fire at once).
Measured.
Stronghold Crusader.exe(3bb0a8c1…5387ac5a), both resolversets enabled locally (not committed), and sourcehold's reccmp with
--resolve-wrapped-calls --ignore-security-cookie./GLlist (main's plus the one line this commit adds), and with 0x004314E0 (theMapEditorLandscaping_GeneralButtonshandler) left out and its resolver off, as in main's baseline: 0 failed of 2,426 compile steps, 99.58 over 2,442 functions.UpdateSiegeTentreads 100.0 raw and normalised there too, with no diff entry. No main function reads differently: against main's own build (made at f489b72, 2,439 functions) the only other changes are main's since then, One more UI::MenuModals function at 100%: ProgressBarBox #467'sMenuModalRenderFunction_ProgressBarBoxand UI: the single-player game launch at 100% #466'sLaunchSinglePlayerGameUnkat 100.0 andConstructor_MenuModal_ProgressBarBoxat 100.0 (93.8 before One more UI::MenuModals function at 100%: ProgressBarBox #467); every other function reads exactly what it read before (unrounded 99.5790 raw and 99.5529 normalised, 2,326 functions at 100.0 raw; main 0e4a83b alone: 99.5788 and 99.5528 over 2,441, 2,325 at 100.0).includes is the same there as on main 0e4a83b, and its one callee,
calculatePreferredRelativeOrientation,is reimplemented in neither). With this file and its
/GLline:UpdateSiegeTent100.0% raw and normalised, nodiff entries, 345 functions, none of the other 344 reading differently from the build without it.
Checks:
openshc-pr-checkgives 0 ERROR and 1 CHECK:field_0x3bcis a placeholder name (see above).Other PRs
UpdateSiegeTent.cppand one more status hunk, at0x005307B0 (100.0% here against his 69.4%). Once this lands, his branch can take main's version.
of
cmake/compiler-flags-gl.txt, so whichever goes in second gets a small conflict there: keep the lines ofboth (reimpl/BuildingsState #234, Reimpl/units state #238, Reimpl/viewport render state #241, reimplement OpenSHC::Text::TextManager and OpenSHC::Text::UserTextHandler #265, Reimplement 3 UI::MenuItems functions from gynt's drafts (not yet 100%) #328 and Reimplement 67 Map::TileMapState functions (batch 2) #396 conflict there too, but they already conflict with main). Reimplement 47 UnitsState functions at 100% and restyle 28 more #378,
Map::Units::UpdateLion at 100% #425, Reimplement 20 BuildingsState functions at 100% #377, Reimplement 88 Map::TileMapState functions at 100% #366 and Reimplement the remaining Map::Buildings Update* functions #297 merge cleanly. Checked with
git merge-treeagainst every open PR's head.🤖 Generated with Claude Code