feat(runtime): add a settings file for values found during bring-up #66

Manually merged
github merged 1 commit from gh-pr/66/head into gh-pr/66/base 2026-11-26 19:17:10 +00:00
Owner

@⁠Dark3581 on GitHub · 2026-11-23 01:55 UTC · original
Dark3581:feat/bringup-settings → main · +268 −4 · 12 files · 1 commits · merged 2026-11-23 01:59 UTC

What

A settings file for build-dependent values found during bring-up, so trying one needs no rebuild:

  • AbxSetting(key) in the runtime:
    • reads anybox.cfg beside the executable (or the file ANYBOX_CONFIG names) once, on first use rather than in DllMain, and ANYBOX_SET="key=value;..." overrides it for one run;
    • the format is one lower-case key = value per line, with # starting a comment so each value can carry where it came from;
    • malformed and repeated lines are logged (the last value wins), and every value a library reads is logged once with its source, for example setting d3d12_x.descriptor_size.render_target = 128 (from anybox.cfg:7);
    • an unset key returns null, so unset stays distinct from 0. Parsing is in runtime/src/Settings.cpp.
  • d3d12_x: DescriptorSizesFromSettings reads d3d12_x.descriptor_size.{shader_resource,sampler,render_target,depth_stencil} into the DescriptorSizes from #63. ParseDescriptorSize accepts decimal or 0x values from 1 to 65535 and refuses anything else with the key named. The device is to read these values when it exists; until a value is set, heaps of that type stay refused as before.
  • docs/dev/GAME_TESTING.md gets "Settings for values found during bring-up": the file format, a provenance comment example, the rule that a value only becomes a default once confirmed and sourced, and the key table. The descriptor-size debt entry points at the keys.

Tested

Windows 10, MinGW (GCC) and MSVC 2022.

  • pso_probe settings-selftest, run by the pipeline_state test in three configurations:

    • a file with a comment, a hexadecimal value, a blank line, a malformed line and a repeated key, plus ANYBOX_SET. Checks: the sizes come out as 32/16/128/48; the override and an unrelated key are read; an unset key is null; the log has the count, the malformed-line and replacement warnings, and one source line per read key;
    • a missing ANYBOX_CONFIG file: all four sizes stay unset and the unreadable file is logged;
    • an invalid value: refused with the key named.

    It also checks ParseDescriptorSize with hexadecimal, unset, and six bad inputs.

  • MinGW ctest: 73 of 73. With MSVC, pipeline_state and the stub e2e tests pass, and every target builds except ab_gameinput, which needs gameinput.lib, which this machine doesn't have. python tools/check_conventions.py and debt_fold.py --check: ok.

The values in the test file are test values, not a console's.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • python tools/check_conventions.py passes (no comments in code, one declaration per export, Conventional Commit subjects)
  • Unimplemented paths stop (AbxNotImplemented / AbxUnsupported); silent stubs are listed under Silent stubs through a debt fragment
  • Known gaps added, changed or removed through docs/dev/debt/changes/<branch>.md
  • Generic behaviour, not specific to one title
  • No game files, keys, notes or logs added to the repository
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • Source of behaviour: n/a (AnyBox's own configuration format)
  • AI-assisted: yes
**@⁠Dark3581** on GitHub · 2026-11-23 01:55 UTC · [original](https://github.com/Dark3581/AnyBox/pull/66) `Dark3581:feat/bringup-settings` → `main` · +268 −4 · 12 files · 1 commits · merged 2026-11-23 01:59 UTC ### What A settings file for build-dependent values found during bring-up, so trying one needs no rebuild: - **`AbxSetting(key)`** in the runtime: - reads `anybox.cfg` beside the executable (or the file `ANYBOX_CONFIG` names) once, on first use rather than in `DllMain`, and `ANYBOX_SET="key=value;..."` overrides it for one run; - the format is one lower-case `key = value` per line, with `#` starting a comment so each value can carry where it came from; - malformed and repeated lines are logged (the last value wins), and every value a library reads is logged once with its source, for example `setting d3d12_x.descriptor_size.render_target = 128 (from anybox.cfg:7)`; - an unset key returns null, so unset stays distinct from 0. Parsing is in `runtime/src/Settings.cpp`. - **d3d12_x:** `DescriptorSizesFromSettings` reads `d3d12_x.descriptor_size.{shader_resource,sampler,render_target,depth_stencil}` into the `DescriptorSizes` from #63. `ParseDescriptorSize` accepts decimal or `0x` values from 1 to 65535 and refuses anything else with the key named. The device is to read these values when it exists; until a value is set, heaps of that type stay refused as before. - `docs/dev/GAME_TESTING.md` gets "Settings for values found during bring-up": the file format, a provenance comment example, the rule that a value only becomes a default once confirmed and sourced, and the key table. The descriptor-size debt entry points at the keys. ### Tested Windows 10, MinGW (GCC) and MSVC 2022. - `pso_probe settings-selftest`, run by the `pipeline_state` test in three configurations: - a file with a comment, a hexadecimal value, a blank line, a malformed line and a repeated key, plus `ANYBOX_SET`. Checks: the sizes come out as 32/16/128/48; the override and an unrelated key are read; an unset key is null; the log has the count, the malformed-line and replacement warnings, and one source line per read key; - a missing `ANYBOX_CONFIG` file: all four sizes stay unset and the unreadable file is logged; - an invalid value: refused with the key named. It also checks `ParseDescriptorSize` with hexadecimal, unset, and six bad inputs. - MinGW `ctest`: 73 of 73. With MSVC, `pipeline_state` and the stub e2e tests pass, and every target builds except `ab_gameinput`, which needs `gameinput.lib`, which this machine doesn't have. `python tools/check_conventions.py` and `debt_fold.py --check`: ok. The values in the test file are test values, not a console's. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] `python tools/check_conventions.py` passes (no comments in code, one declaration per export, Conventional Commit subjects) - [x] Unimplemented paths stop (`AbxNotImplemented` / `AbxUnsupported`); silent stubs are listed under Silent stubs through a debt fragment - [x] Known gaps added, changed or removed through `docs/dev/debt/changes/<branch>.md` - [x] Generic behaviour, not specific to one title - [x] No game files, keys, notes or logs added to the repository - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] Source of behaviour: n/a (AnyBox's own configuration format) - [x] AI-assisted: yes
AbxSetting reads anybox.cfg beside the executable, overridable with ANYBOX_SET, and logs each value with its source. d3d12_x reads the four descriptor sizes from it, so a console increment found in a title can be tried without a rebuild.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 19:17:09 +00:00
github manually merged commit 94f3d3adc7 into gh-pr/66/base 2026-11-26 19:17:10 +00:00
This discussion has been locked. Commenting is limited to contributors.
No description provided.