docs(env): describe the default host import budget as HostImportBudget computes it #7808

Merged
parl0v merged 1 commit from upstream-pr/7808 into main 2026-10-19 17:35:48 +00:00
parl0v commented 2026-10-19 08:21:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by parl0v on 2026-10-19T08:21:53Z.


What

The APS5_HOST_IMPORT_MIB row in docs/dev/ENVIRONMENT.md said the default was 6144 MiB, that 6144 is the floor, and that an unset value uses the largest host heap minus 2 GiB. None of that matches HostImportBudget in GuestBufferMemory.cpp, which importBudget uses when the variable is unset or 0:

const auto fromMemory = std::max<std::uint64_t>(6144ull << 20u, physicalBytes / 2);
const auto reserve = std::max<std::uint64_t>(2048ull << 20u, hostHeap / 2);
return hostHeap > reserve ? std::min(fromMemory, hostHeap - reserve) : fromMemory;

So 6144 MiB is not a floor (the host heap cap can take the budget below it), and the reserve is the larger of 2 GiB and half the heap, not 2 GiB. The row now says 0 selects the budget automatically and gives the formula as the code and its header comment state it, with the value I see on a 16 GB machine.

Tested

  • Windows 10 19045, 16 GB RAM, RTX 4060 8 GB (NVIDIA 617.42), main 46f27623c, Minecraft Dungeons II (PPSA16064) world load with the variable unset: the driver logs [gpu] host import budget: 4055 MiB live of 4055 MiB, below the 6144 MiB the row called the floor.
  • tools/check_conventions.py --base origin/main passes.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a (documentation only)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4917999858 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7808). Originally posted by [parl0v](https://github.com/parl0v) on 2026-10-19T08:21:53Z. --- ### What The `APS5_HOST_IMPORT_MIB` row in `docs/dev/ENVIRONMENT.md` said the default was 6144 MiB, that 6144 is the floor, and that an unset value uses the largest host heap minus 2 GiB. None of that matches `HostImportBudget` in `GuestBufferMemory.cpp`, which `importBudget` uses when the variable is unset or 0: ```cpp const auto fromMemory = std::max<std::uint64_t>(6144ull << 20u, physicalBytes / 2); const auto reserve = std::max<std::uint64_t>(2048ull << 20u, hostHeap / 2); return hostHeap > reserve ? std::min(fromMemory, hostHeap - reserve) : fromMemory; ``` So 6144 MiB is not a floor (the host heap cap can take the budget below it), and the reserve is the larger of 2 GiB and half the heap, not 2 GiB. The row now says `0` selects the budget automatically and gives the formula as the code and its header comment state it, with the value I see on a 16 GB machine. ### Tested - Windows 10 19045, 16 GB RAM, RTX 4060 8 GB (NVIDIA 617.42), `main` 46f27623c, Minecraft Dungeons II (PPSA16064) world load with the variable unset: the driver logs `[gpu] host import budget: 4055 MiB live of 4055 MiB`, below the 6144 MiB the row called the floor. - `tools/check_conventions.py --base origin/main` passes. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [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] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a (documentation only) - [x] AI-assisted: yes
github-actions[bot] commented 2026-10-19 08:31:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T08:31:32Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 5431 docs/dev/ENVIRONMENT.md
PR 6636 docs/dev/ENVIRONMENT.md
PR 6946 docs/dev/ENVIRONMENT.md
PR 6947 docs/dev/ENVIRONMENT.md
PR 7332 docs/dev/ENVIRONMENT.md
PR 7417 docs/dev/ENVIRONMENT.md
PR 7484 docs/dev/ENVIRONMENT.md
PR 7604 docs/dev/ENVIRONMENT.md
PR 7642 docs/dev/ENVIRONMENT.md
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6263053712 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7808#issuecomment-6263053712). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-19T08:31:32Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `docs/dev/ENVIRONMENT.md` | | [PR 6636](https://www.github.com/boykopovar/AnyPS5/pull/6636) | `docs/dev/ENVIRONMENT.md` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `docs/dev/ENVIRONMENT.md` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `docs/dev/ENVIRONMENT.md` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `docs/dev/ENVIRONMENT.md` | | [PR 7417](https://www.github.com/boykopovar/AnyPS5/pull/7417) | `docs/dev/ENVIRONMENT.md` | | [PR 7484](https://www.github.com/boykopovar/AnyPS5/pull/7484) | `docs/dev/ENVIRONMENT.md` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `docs/dev/ENVIRONMENT.md` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `docs/dev/ENVIRONMENT.md` |
adriadam10 commented 2026-10-19 17:38:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-19T17:38:27Z.


Checked the row against HostImportBudget and importBudget in GuestBufferMemory.cpp: the formula and the 0 default match; merged.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6273373424 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/7808#issuecomment-6273373424). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-19T17:38:27Z. --- Checked the row against `HostImportBudget` and `importBudget` in `GuestBufferMemory.cpp`: the formula and the `0` default match; merged.
Sign in to join this conversation.
No reviewers
No labels
No milestone
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.

Reference
boykopovar/AnyPS5!7808
No description provided.