Record the compile flags a build actually used #2576

Closed
opened 2026-11-11 23:59:33 +00:00 by steefzilla · 2 comments
steefzilla commented 2026-11-11 23:59:33 +00:00 (Migrated from github.com)

The idea

A built game does not say which CPU flags produced it. hookshot_version.txt stores the release and the builder path. The binary's version string stores the release and a hash of the sources. The build log prints a hash of the flags (object keys: … flags …) so two logs can be compared, and that hash is not the flags and is not kept in the game folder.

Two builds of the same release can still differ: host_march() chooses x86-64, x86-64-v2, or x86-64-v3, and RX_MARCH can name something else (znver2, rocketlake). On a Steam Deck, nightly also adds -mtune=znver2 only while that machine is doing the compile. Nothing written next to bin/hookshot records that choice, so a player, a bug report, and a later update cannot tell what this binary was built for.

Record the flags that change the generated code, the same set flag_text() already hashes, minus include paths. That is -march, -mtune when set, -ffp-contract, and any extra CPU flags passed for that build. Write them in the game folder beside hookshot_version.txt, and compile the same text into the binary the way HOOKSHOT_VERSION is compiled in, so the log can print it. -ffp-contract=off stays part of the recorded set, since the lifted code depends on it.

Checked on v2.1.0, the newest release, and on nightly (fce53453, 187 commits later, 11 November 2026). Neither records these flags.

Anything else

RX_CPU_FLAGS does not exist in the repository today. An extra flag such as -mprefer-vector-width=256 only survives if the person compiling exports it for that one run. DLSS is already remembered separately (the builder checkbox, and on nightly nvidia_license=1 in builder.ini, #2485). This request is the CPU flags, not that checkbox.

### The idea A built game does not say which CPU flags produced it. `hookshot_version.txt` stores the release and the builder path. The binary's version string stores the release and a hash of the sources. The build log prints a hash of the flags (`object keys: … flags …`) so two logs can be compared, and that hash is not the flags and is not kept in the game folder. Two builds of the same release can still differ: `host_march()` chooses `x86-64`, `x86-64-v2`, or `x86-64-v3`, and `RX_MARCH` can name something else (`znver2`, `rocketlake`). On a Steam Deck, `nightly` also adds `-mtune=znver2` only while that machine is doing the compile. Nothing written next to `bin/hookshot` records that choice, so a player, a bug report, and a later update cannot tell what this binary was built for. Record the flags that change the generated code, the same set `flag_text()` already hashes, minus include paths. That is `-march`, `-mtune` when set, `-ffp-contract`, and any extra CPU flags passed for that build. Write them in the game folder beside `hookshot_version.txt`, and compile the same text into the binary the way `HOOKSHOT_VERSION` is compiled in, so the log can print it. `-ffp-contract=off` stays part of the recorded set, since the lifted code depends on it. Checked on v2.1.0, the newest release, and on `nightly` (`fce53453`, 187 commits later, 11 November 2026). Neither records these flags. ### Anything else `RX_CPU_FLAGS` does not exist in the repository today. An extra flag such as `-mprefer-vector-width=256` only survives if the person compiling exports it for that one run. DLSS is already remembered separately (the builder checkbox, and on `nightly` `nvidia_license=1` in `builder.ini`, #2485). This request is the CPU flags, not that checkbox.
NotRexed commented 2026-11-12 03:08:09 +00:00 (Migrated from github.com)

Thanks for the report. Reports of the same kind are collected in #2505, which lists this one with your details and links back here, so one fix closes them together. Follow #2505 for the fix and add new details there (or here). If this turns out to be separate it will be reopened.

Thanks for the report. Reports of the same kind are collected in #2505, which lists this one with your details and links back here, so one fix closes them together. Follow #2505 for the fix and add new details there (or here). If this turns out to be separate it will be reopened.
steefzilla commented 2026-11-12 03:47:46 +00:00 (Migrated from github.com)

Thanks for looking. This is a feature request, not a failed build: record the CPU flags a build used, in the game folder and in the log. #2505 is for builds that fail, run out of disk, or take too long, and its list does not mention this. Could it be reopened as separate?

Thanks for looking. This is a feature request, not a failed build: record the CPU flags a build used, in the game folder and in the log. #2505 is for builds that fail, run out of disk, or take too long, and its list does not mention this. Could it be reopened as separate?
Commenting is not possible because the repository is archived.
No milestone
No assignees
1 participant
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
MagicBeanDev/Hookshot#2576
No description provided.