A client fix and a tests update (the "Discuss and improve release tests" work). No server, protocol or file format change: 1.18.26 plays with 1.18.22 to 1.18.25 (protocol 44). Times are from q's Windows 10 PC (20 logical CPUs) and a 4-core Linux cloud box.
Weapon prediction (client)
- After a knife or syringe throw, the predicted weapon stays the one held before it. Since 1.18.7 the client
predicts the throw (
WeaponPredictor::thrown: back to the weapon held before the knife, as the server does since T14). But the commands after it rebuilt the prediction from the latest snapshot, which for one round trip still shows the knife held; with the knife away that rule gives the first slot, the rocket. So the view model, HUD and local fire feedback showed the rocket for one ping, then the right weapon.run()now keeps whatthrown()predicted while the snapshot still holds the away weapon (only then: the server's word wins as soon as it changes). Cost: four compares per tick. - Found through the Windows test run: at Windows' 1x test pace a client tick falls inside that window; at Linux's 4x
it never did, so the server-checked test missed it. A direct
WeaponPredictorcheck now covers it on every platform (it fails without the fix).
Tests
- Windows runs the test groups in parallel processes.
quark_tests.exewith no argument starts each group asquark_tests.exe group NAME --child(CreateProcessW), several at once, with its output in a temp log printed in the suite's order, then runs tickrate, netcode and weaponpredict one at a time, as Linux does with fork. On q's PC: 837.7 s one after another, 199.9 s in parallel (4.2x). The longest groups (rules ~97 s, rules2 ~96 s, weapons ~77 s) now set the time, so more jobs don't help (60 jobs: 199.8 s); Windows uses 1 job per logical CPU (3 per core under Wine missed 55-90 real-time checks).- Shared scheduler for both platforms (
tests/groupproc.cpp: fork on Linux / macOS, CreateProcessW on Windows). - The parent passes its port block to the children (
QUARK_TEST_PORTSHIFT), so each group keeps its own ports. - Children run in a job object that kills them with the parent (watchdog, Ctrl+C, a crash); compute-only groups run at BELOW_NORMAL priority (nice 10 on Linux); a crash dialog never waits.
- A child that exits without its "group finished" line counts as a failure (Wine reports 0 for a killed process); an exception exit code is reported as a crash.
QUARK_TEST_JOBS=Nsets the job count andQUARK_TEST_ONLY=a,bruns only those groups, on both platforms.- Linux is unchanged: ~107-113 s.
- Shared scheduler for both platforms (
- weaponpredict on Windows: the two "shown from the key" checks pumped 2 ms; at 1x that ran a second command after
the server's refusal of the locator had come back, so
lastPred == WPN_LOCATORfailed in every Windows run. They now run exactly one command before the server runs anything. - Payload push waits up to 2 s more for the freeze to end before checking the round is live (it missed the 3.2 s window once in a full run on a loaded box; the check itself is unchanged).