[PR #1628] runtime: generate shared BCPack tables once in parallel builds #1640

Open
opened 2026-11-26 20:21:57 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1628
Author: @sodove
Created: 11/25/2026
Status: 🔄 Open

Base: main ← Head: fix/bcpack-tables-build-race


📝 Commits (1)

  • 3da3c7f runtime: generate shared BCPack tables once per build

📊 Changes

1 file changed (+6 additions, -2 deletions)

View changed files

📝 runtime/CMakeLists.txt (+6 -2)

📄 Description

Claimed in the coordination issue as: RT-BCPACK-TABLES-BUILD-RACE.

What and why

On a clean parallel Visual Studio build, both the history trainer and the runtime decoder ran the generator for bcpack_tables.inc. One observed build failed with Python PermissionError and MSBuild MSB8066. A clean build of 42537e7b6 ran it twice even when the build succeeded.

Give the existing output rule a single CMake target and make both consumers depend on it. Their C++ compile steps can still run in parallel once the include exists. The generator, its inputs and the generated bytes are unchanged.

Tested

Native Windows 11 x64, MSVC, RelWithDebInfo. All inputs were synthetic or from the repository.

Check Result
Visual Studio 2022, clean parallel build One project owns the generator rule (two on base), one generator invocation
Rebuild with no changes, then rebuild after removing the generated include Zero invocations, then one. Both consumers recompiled and the regenerated include matched the clean build byte for byte.
Ninja, touch a generator input in a scratch source tree One invocation and both consumers recompiled. The next build did no work.
History trainer on one valid and one malformed synthetic stream Both builds accepted one, rejected one and produced identical output.
CPU-only runtime CTest 144 passed, including dstorage. Seven package-dependent tests skipped and two SDL tests were disabled.
Translator semantic suite 487 files, 6,279 tests, zero failing files.
BCPack table unit tests 55 passed.

GPUs tested: n/a (host build and CPU tests).

AI-assisted: yes (OpenAI Codex).

Checklist

  • Based on current main.
  • One topic.
  • No game data, keys or decryption.
  • Translator contract update is inapplicable to this build change.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/1628 **Author:** [@sodove](https://github.com/sodove) **Created:** 11/25/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/bcpack-tables-build-race` --- ### 📝 Commits (1) - [`3da3c7f`](https://github.com/ubiquitarianism/leonida/commit/3da3c7ffed669997152debc34e06de078ed4f1c2) runtime: generate shared BCPack tables once per build ### 📊 Changes **1 file changed** (+6 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `runtime/CMakeLists.txt` (+6 -2) </details> ### 📄 Description Claimed in the coordination issue as: [RT-BCPACK-TABLES-BUILD-RACE](https://github.com/ubiquitarianism/leonida/issues/1608#issuecomment-7154531555). ### What and why On a clean parallel Visual Studio build, both the history trainer and the runtime decoder ran the generator for `bcpack_tables.inc`. One observed build failed with Python `PermissionError` and MSBuild `MSB8066`. A clean build of `42537e7b6` ran it twice even when the build succeeded. Give the existing output rule a single CMake target and make both consumers depend on it. Their C++ compile steps can still run in parallel once the include exists. The generator, its inputs and the generated bytes are unchanged. ### Tested Native Windows 11 x64, MSVC, RelWithDebInfo. All inputs were synthetic or from the repository. | Check | Result | | --- | --- | | Visual Studio 2022, clean parallel build | One project owns the generator rule (two on base), one generator invocation | | Rebuild with no changes, then rebuild after removing the generated include | Zero invocations, then one. Both consumers recompiled and the regenerated include matched the clean build byte for byte. | | Ninja, touch a generator input in a scratch source tree | One invocation and both consumers recompiled. The next build did no work. | | History trainer on one valid and one malformed synthetic stream | Both builds accepted one, rejected one and produced identical output. | | CPU-only runtime CTest | 144 passed, including `dstorage`. Seven package-dependent tests skipped and two SDL tests were disabled. | | Translator semantic suite | 487 files, 6,279 tests, zero failing files. | | BCPack table unit tests | 55 passed. | GPUs tested: n/a (host build and CPU tests). AI-assisted: yes (OpenAI Codex). ### Checklist - [x] Based on current `main`. - [x] One topic. - [x] No game data, keys or decryption. - [x] Translator contract update is inapplicable to this build change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#1640
No description provided.