Faces (and some other things) render wrong without a records bounds clamp (VICTORY_REC_BOUNDS) #18

Closed
opened 2026-12-01 07:41:22 +00:00 by github-bot · 2 comments
Owner

@⁠ghsali on GitHub · 2026-11-30 03:47 UTC · original

On main at lobomfz/VIctory-xmem@cd811c1 plus a few local patches (unrelated), the intro's character faces are wrong, and there are some other visual artifacts. Debian 13, Radeon R9700, FSR 4 Performance, ray tracing on, intro save.

Cause: before lobomfz/VIctory-xmem@2773fdf, lower.rs skipped the record bounds clamp (Lower::at()) when VICTORY_REC_BOUNDS=0 was set. That commit removed the switch, so the clamp always runs. A read through a record that reaches the record's length is sent to 0xFFFFFFF0, which reads as zero.

I A/B tested this on the same executable, same save, same warmed cache, only the setting changed:

  • VICTORY_REC_BOUNDS=0: faces correct, no artifacts.
  • VICTORY_REC_BOUNDS=1 (clamp on): faces wrong, plus other artifacts (which aren't there with the clamp off)

I saw no slowdown with it off (intro, ~27 fps either way; 13.1 vs 13.7 ms per 1,000 draws

We should bring the switch back in, or fix the lengths for the affected buffers, but I am not sure how to get the face data isolated.

I have not made a PR with this added back in as I am not sure if that is the best way of doing a fix here.

**@⁠ghsali** on GitHub · 2026-11-30 03:47 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/18) On main at lobomfz/VIctory-xmem@cd811c1 plus a few local patches (unrelated), the intro's character faces are wrong, and there are some other visual artifacts. Debian 13, Radeon R9700, FSR 4 Performance, ray tracing on, intro save. Cause: before lobomfz/VIctory-xmem@2773fdf, lower.rs skipped the record bounds clamp (Lower::at()) when VICTORY_REC_BOUNDS=0 was set. That commit removed the switch, so the clamp always runs. A read through a record that reaches the record's length is sent to 0xFFFFFFF0, which reads as zero. I A/B tested this on the same executable, same save, same warmed cache, only the setting changed: - VICTORY_REC_BOUNDS=0: faces correct, no artifacts. - VICTORY_REC_BOUNDS=1 (clamp on): faces wrong, plus other artifacts (which aren't there with the clamp off) I saw no slowdown with it off (intro, ~27 fps either way; 13.1 vs 13.7 ms per 1,000 draws We should bring the switch back in, or fix the lengths for the affected buffers, but I am not sure how to get the face data isolated. I have not made a PR with this added back in as I am not sure if that is the best way of doing a fix here.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-01 07:41:22 +00:00
Author
Owner

@⁠jaudo on GitHub · 2026-11-30 12:33 UTC · original

Same issue with face here (when characters talk, their face distorts). Any fix?

**@⁠jaudo** on GitHub · 2026-11-30 12:33 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/18#issuecomment-7278608570) Same issue with face here (when characters talk, their face distorts). Any fix?
Author
Owner

@⁠maple-quartz18 on GitHub · 2026-12-04 13:24 UTC · original

Same issue with face here when VICTORY_RECORD_RANGES=1

**@⁠maple-quartz18** on GitHub · 2026-12-04 13:24 UTC · [original](https://github.com/lobomfz/VIctory-xmem/issues/18#issuecomment-7412839952) Same issue with face here when VICTORY_RECORD_RANGES=1
This discussion has been locked. Commenting is limited to contributors.
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.

Dependencies

No dependencies set

Reference
github/lobomfz--VIctory-xmem#18
No description provided.