Repository navigation
Port Benchmark & Optimizer to Timberborn 1.1 (isolated profiling and safe tick intervals) [upstream candidate] - #6
Draft
tharbad08 wants to merge 43 commits into
Conversation
… 1.1 Add standalone BenchmarkAndOptimizerV11Port with runtime CSV and frame/GC benchmarks, opt-in guarded tick intervals, ModSettings UI, isolated compile-time stubs and GitHub Actions build. Preserve the original Update 7 mod unchanged.
tharbad08
changed the base branch from
master
to
pr/upstream-master-baseline-20261015
October 15, 2026 20:17
Use default C# visibility, camelCase member names without underscore prefixes, record structs for immutable metadata, modern collection expressions and guarded control-flow blocks. Preserve profiler behavior and v1.1 manifest version.
…migrations and defaults
…ing dynamic method discovery
Restore the proven non-public options-root lookup after v1.1.108 reintroduced direct access that crashed Unity Mono during game load. Keep the compile-only _root stub non-public and add a CI regression guard. Bump manifest, assembly, and artifact build numbers together; document the runtime failure.
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.
Summary
Standalone Timberborn 1.1 port of Benchmark & Optimizer, derived from the project's existing v1.1 implementation. The original
BenchmarkAndOptimizer/mod is untouched. The port remains separate from the gameplay-focused TB Optimizer.This supersedes closed PR datvm#46, whose branch had diverged and unintentionally included thousands of unrelated files. This PR is rebased onto the current upstream
masterwith one commit and 38 files: theBenchmarkAndOptimizerV11Port/module plus its dedicated GitHub Actions workflow.Features
StepAll/Physics.Simulate), when available.optimizer-v11.json.Compatibility and design
BenchmarkAndOptimizerV11Port; dedicated .NET Standard 2.1 project and isolated test/build-time stubs.Testing / review checklist
tharbad08.Agents.MDand original Benchmark & Optimizer author conventions; style cleanup committed as3deafdeb.Known limitations
See
BenchmarkAndOptimizerV11Port/README.mdandTICK_SAFETY.mdfor details.Author:
tharbad08. Please leave as draft until game validation is complete.Upstream comparison: datvm/TimberbornMods@master...tharbad08:TimberbornMods:pr/benchmark-optimizer-v11-clean
Pause-menu compatibility fix (2026-10-16)
BenchmarkAndOptimizerV11to manifest IDBenchmarkAndOptimizerV11Port.rootElementlookup with the original author's direct publicizedGameOptionsBox._rootaccess; preserve external game field names when applying member style rules.38859797534compiled successfully and uploaded an installable ZIP; game-side verification remains pending.Timberborn 1.1 runtime API fix (2026-10-16)
FieldAccessExceptionatBenchmarkAndOptimizerV11.OptimizerMenuService.Load: direct access to the game-privateGameOptionsBox._rootprevented colony loading._rootonly as the exact external game field-name string, accessed via reflection with non-public binding flags; our own members followAgents.MDand do not use underscore-prefixed fields._rootnon-public so accidental direct access fails future builds.38867544608succeeded on commitfaf95230, and ZIP integrity was checked. Pause menu still requires in-game verification.Coexistence contract with TB Optimizer
Both mods are intended to run together. TB Optimizer (separate
TBOptimizerassembly/mod ID/Harmony owner) retains stable fixes; Benchmark & Optimizer is the separate diagnostic profiler with opt-in intervals. During a benchmark, only B&O's interval throttles are suspended; all TB Optimizer fixes stay active. Shared targets includeSingletonLifecycleService.UpdateSingletons(B&O profiling and TB Optimizer GC hook) and optional TimberPhysics execution (B&O timings with TB Optimizer catch-up logic). No conflict found in static source inspection, but live combined-stack profiling remains to be tested. Source review details added toBenchmarkAndOptimizerV11Port/README.md. Do not tell testers to disable TB Optimizer.Optional load-order dependency
BenchmarkAndOptimizerV11Port/manifest.jsonnow declaresTBOptimizerinOptionalMods, notRequiredMods, so Timberborn loads stable fixes first when both are enabled, without making TB Optimizer necessary for standalone benchmarking. No reciprocal declaration in TB Optimizer. Manifest version follows the new build convention and is now 1.1.104. Validate the resolved order inPlayer.logwhen testing.Build version convention correction
Manifest
Version=1.1.104, projectAssemblyVersion/FileVersion=1.1.104.0, GitHub Actions artifact nameBenchmarkAndOptimizerV11Port_1.1.104. The shared project and TB Optimizer AGENTS guides now specify<game version>.<build number>with a build-number increment on every changed installable test/release binary. CI artifact from run38868790897was retrieved and ZIP integrity verified; in-game runtime validation is pending.1.1.109 runtime crash fix (2026-10-18)
User's
Player(20261018-020758).logconfirmsFieldAccessExceptionfrom B&OOptimizerMenuService.Load()on directGameOptionsBox._rootaccess during colony startup. Version 1.1.108's publicized-reference/IgnoresAccessChecksTostrategy compiled but still failed on Unity Mono. Restored guarded reflection of the existing private game field, left local naming conventions intact, made compile-only_rootnon-public, and added a CI regression check to block direct access. Manifest/assembly/artifact all bumped to 1.1.109. Build passed, ZIP validated, but corrected 1.1.109 has not yet been tested inside the game. TB Optimizer 1.1.120 starts before B&O and is not implicated.