Skip to content

Added vscript runtime checksum data#361

Open
betsruner wants to merge 3 commits into
p2sr:masterfrom
betsruner:vscript-improvement
Open

Added vscript runtime checksum data#361
betsruner wants to merge 3 commits into
p2sr:masterfrom
betsruner:vscript-improvement

Conversation

@betsruner
Copy link
Copy Markdown
Member

Issue / Solution

This is fixing the issue of SAR only calculating vscript checksums when the plugin is loaded.

This adds a secondary check to the vscript compile execution path. It records the script name, and a checksum of the runtime script buffer to demos.

Notes

  • Tested and working on Linux (Ubuntu 22.xx)
  • The runtime script buffer checksums do align with the filechecksums from the game
  • Queue's the vscripts executed during map load (similar to queued commands)
  • Added as a new data type in case we want to treat this differently than regular file sums.
  • Upcoming mdp PR will have a config option to not show the new vscript data (it'll be spammy for a while until we filter them)

Testing

I only tested a chapter run and a single demo (on linux and windows). For the single demo I started the demo a bit into the level to ensure the queuing was working correctly. I'll attach the mdp output to the PR in case anyone wants to have a look.
output.txt

@ThisAMJ
Copy link
Copy Markdown
Member

ThisAMJ commented May 6, 2026

The cursor is strong with this one. The signing should be in src/Checksum.cpp and header included in module. The hook should use a signature or otherwise guarantee that the address is correct (the check will always return true if the module exists), the module should be grabbed using MODULE("vscript") in its own module like src/modules/VPhysics.cpp(/.hpp) was for the INFRA memory leak. testing should be done on other supported games (on both platforms) to verify that we don't break shit again, should use the crc32 function provided in Checksum instead of lodepng. Wherever possible use our macros instead of adding your own platform checks

@betsruner
Copy link
Copy Markdown
Member Author

Wasn't able to test it fully for every game / platform supported.
For some incredibly curious reason whenever I load SAR on linux in any of the supported games other than Portal 2 it just crashes. It's not my changes, it does it for main too. No crash report either. I tried debugging it but when I do that the crash doesn't happen but SAR does output many errors in console. Can't even load the vanilla 1.15 download (although that appears to be a different issue). I'm not even on a weird distro or anything, I'm on the most vanilla Ubuntu 22.0x version with only the essentials installed.

Here's what I did confirm works (everything I own where linux wasn't experiencing catastrophic issues):
Windows:
Portal 2 (Steam)
Portal 2 (Release) (just tested with console output since the information can't be put into demos)
Mel
TWTM
Aperture Tag
Portal Reloaded (1.0.0)
Portal Reloaded (1.1.0)
Portal Reloaded (1.2.0) (Same as default public version I believe)

Linux:
Portal 2 (Steam)

If some of the PR is too slop still then lmk I don't mind fixing that, but I'm done dealing with weird linux issues at this point. It's not integral this change make it into the next version if the PR still requires too much work or if the linux issues make you unconfident without more testing and you just want to get the current linux fix into a version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants