aspect: ultrawide camera and field of view (VICTORY_ASPECT, VICTORY_FOV) #472
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!472
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-472"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@mirrox1337 on GitHub · 2026-12-04 15:03 UTC · original
mirrox1337:ultrawide-fov→main· +212 −0 · 5 files · 1 commits · openWhat
Two settings that change what the title's camera shows, without touching the title's code:
VICTORY_ASPECT2560x1080,3440x1440,5120x1440, or a ratio such as2.39VICTORY_FOV0.5to2.01.25is a quarter more each way)Both are off unless set.
How
The title's 16:9 perspective projections are rewritten in the sources of the copies that go up to the card, just before they are copied (
host/send.rs):_22is divided by the field factor and_11becomes_22 / aspect. Orthographic (interface) matrices and projections that are not at 16:9 (shadow cascades, cube maps) are left alone.The picture stays 16:9. With
VICTORY_ASPECTit is an anamorphic one that the screen or compositor has to stretch, for examplegamescope -W 3440 -H 1440 -w 2560 -h 1440 -S stretch.crate::aspectis Kemerd/VIctory-NVIDIA-RT'scrates/victory-gpu/src/aspect.rs(GPL-3.0), called at the same point as there.VICTORY_FOV(fov,on) is added here.Files
crates/victory-gpu/src/aspect.rs: the module (new).crates/victory-gpu/src/host/send.rs: the call before the copies (7 lines);lib.rs:mod aspect.docs/SETTINGS.md,run.conf.default: both settings, so the F1 menu lists them.Tested
PKG=victory-gpu ./build.sh test aspect: 4 tests pass (one added for the field arithmetic).cargo xtask policypasses.-S stretch.VICTORY_ASPECT=3440x1440fills the screen with a correctly proportioned world.VICTORY_FOV=1.15was set in the same sessions; it has had less attention than the aspect.Known limits
VICTORY_FOV.VICTORY_FOVwithoutVICTORY_ASPECTleaves a rewritten matrix at 16:9, so a block copied again without the title rewriting it would be scaled again (noted in the code); not seen in play, since the title writes its projections every frame.🤖 Generated with Claude Code
@chatgpt-codex-connector[bot] on GitHub · 2026-12-04 15:04 UTC · original · edited 2026-12-04 15:08 UTC
Codex Review Summary: ✅ Completed
This comment shows the latest Codex review activity on this pull request.
d2976c2ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.
@chatgpt-codex-connector[bot] on GitHub · 2026-12-04 15:08 UTC · original · reviewed
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit:
d2976c247aℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
@ -227,1 +227,4 @@};// VICTORY_ASPECT (crate::aspect): the title's 16:9 projections in what is about to go up are widened first.if crate::aspect::on() {for &(src, _, len) in moves.iter().filter(|m| m.0 != 0 && m.2 != 0) {@chatgpt-codex-connector[bot] on GitHub · 2026-12-04 15:08 UTC · original
When a camera projection arrives in a ≤256-byte, dword-aligned dirty span,
takeroutes it through the scatter work, butmovescontains only the non-shortcopy.runs, so this loop never tunes it and the scatter then uploads the raw_11/_22, undoing a prior rewrite. Even long spans are scanned relative to their own start, although dirty runs are only dword-aligned andtuneadvances in 16-byte steps, so a matrix in a phase-shifted run is missed too; scan complete matrices on their buffer-aligned grid before splitting sends.Useful? React with 👍 / 👎.
@Kal0s-design on GitHub · 2026-12-04 17:04 UTC · original
Checked
d2976c2against main. Tests ran natively on Windows (MSVC build, not Wine). I did not try it in game.Off by default holds. With both variables unset the only new work on the send path is one
aspect::on()check pertake()call (send.rs:229), which is two cached OnceLock reads. It is not per copy and nothing else intake()changes. The full victory-gpu lib suite gives 343 passed, 5 failed, and all 5 also fail on main (the two indirect host_list tests, the two pipeline library loads, and the flaky watch test). The 4 aspect tests pass. There are no send-specific unit tests, and the host and shadow tests pass apart from those same known ones.Parsing, from a child process per value (aspect.rs:33-62)
3440x1440,2560X1080,5120 x 1440,2.39all parse as expected.21:9and32/9turn the feature off silently. People will type21:9, so either accept:or log a line when the value is rejected. Same forVICTORY_FOV=1,25or2.01, which quietly fall back to 1.0.0x0,1x0,NaN,infand8are rejected, so no NaN or inf reaches the matrix.-3440x-1440is accepted as 2.39, which does no harm.Math
_11 = _22 / aspectkeeps the vertical field and widens the horizontal one, which is correct Hor+. With a 60 degree vertical field, 3440x1440 gives about 108 degrees horizontal against 91.5 at 16:9, and the vertical stays at 60.VICTORY_FOVdivides_22, so it scales tan(half fov) as documented.VICTORY_ASPECTset, a rewritten matrix is no longer picked up again, so rewriting the same bytes repeatedly is a no-op. I checked down to 1.7979.VICTORY_FOValone, running the same bytes through five times rewrote them five times (60 to about 121 degrees vertical at 1.25). You already note this. I could not find a path where the same CPU side goes up twice without a refresh from title memory in between, but I did not prove there is none.Detector (aspect.rs:73-89), from a local test I am not pushing
_43 = ±1: all found, for standard, reversed and infinite reversed z. The 1:1 (shadow/cube), 16:10, orthographic, inverse projection and projection-times-view cases are all left alone._34 = 1,_43 = -zn*q) are never found: 0 of 200k. A projection with TAA jitter or an off-centre term in_13/_23(or_31/_32) is also skipped, and so is one with_22 < 0. You saw it working in game, so the title's matrix presumably has the matched shape. These misses go in the safe direction._44 == 1being accepted (aspect.rs:80). Any affine matrix that has a 16:9 ratio between its x and y scales, no x/y translation and a z translation of exactly ±1 is taken as a projection, and so is an orthographic one that maps z with_43 = -1. In the affine set, all of those I built were matched and nothing else was. Every perspective I tried has_44 == 0, so requiring that would remove this class without losing any of them.Where it runs
tuneruns on the submitting thread insidetake(), before the pair work and beforecopy_all(send.rs:228-242), so the ordering against the copy up is right. It writes to the same memory the existing code already assumes only this thread touches at that point.shadow.card_data(), which is the copy's CPU side (shadow.rs:1442-1444), not title memory. The module doc at aspect.rs:15-17 says the opposite, and aspect.rs:6 points tocrate::shadow::tune_aspect, which does not exist in this repo. Worth fixing so the next reader doesn't rely on it.movesare scanned. Runs that are 4-byte aligned and up to 256 bytes go as pairs (send.rs:27-29, 169, 211-224) and are sent untouched. So a projection that goes up in a small run, for example a small title buffer copy throughsend_copied, keeps 16:9.f32slice cast at aspect.rs:113 needs 4-byte alignment. Runs that are not 4-aligned go tomovestoo (send.rs:27-29). In a debug build the same cast on an odd address aborts the process with Rust's unsafe precondition check. I reproduced that in a test. Release builds don't check, and x86 copes, but it is UB on paper. Reading withread_unaligned/write_unaligned, or skipping misaligned runs, avoids it.Cost when on: the scan reads every byte of every large send once more on the submitting thread. In an unoptimized test build it took about 1.3 to 2 ms per MiB. A release build will be much faster, but I did not measure one.
So it does nothing when off, which is the main thing. When on, the detector looks safe on random data. Suggestions are
_44 == 0, an accepted21:9or a log line on a bad value, an unaligned-safe read, and a corrected doc comment. The small-run and grid gaps are worth a note in Known limits unless the title's camera buffer is known to always go up as a large aligned run.AI-assisted: yes
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.