You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
12:40 AM] drzel: hey @meag I'm really hoping to upgrade my server to 0.32 if possible, is there anything else I can do re: QW-Group/mvdsv#34 ?
GitHub
Server dying after about 90 seconds · Issue #34 · deurk/mvdsv
Hey I'm running 0.31 fine at qw://fortressone.ga Compiled 0.32 and swapped out the binary and the server crashes after about 90 seconds with: sv_error: Program error At least that's what I ...
[12:41 AM] meag: are you compiling it with the same flags etc as you compiled 0.31?
[1:16 AM] Spoike: @drzel which qcc are you using?
[1:18 AM] Spoike: I'm assuming its frikqcc
[1:21 AM] Spoike: frikqcc (when using -O3 or whatever it was) also enables a 'logic-ops' optimisation.
[1:21 AM] Spoike: this allows it to short-circuit conditionals in an attempt to avoid needing to evaluate expensive expressions (like function calls)
[1:23 AM] Spoike: it does this by using OP_IF/OP_IFNOT directly on the lhs of any && or || operators so that it can just skip over the logic needed for the rhs+dependant operations etc
[1:24 AM] Spoike: unfortunately, those two instructions expressely operate only on ints and not floats.
[1:25 AM] Spoike: this means that (-0.0 && -0.0) suddenly ends up considered as true, instead of false.(edited)
[1:26 AM] Spoike: bitwise, -0.0 == 0x80000000, so true
[1:27 AM] Spoike: unfortunately whether a float is 0 or not is more complicated than just testing the non-sign bits.
[1:28 AM] Spoike: not all cpus support denormalised floats for instance, and normally handle them as if they're 0 (this can be a potentially significant speedup for intel cpus for instance).
[1:29 AM] Spoike: so yeah, disable that optimisation or rewrite the qc so that it doesn't matter so much
[1:34 AM] drzel: Hrmmm honestly a lot of that has gone over my head. I’m compiling with gmqcc -std=gmqcc -fftepp @meag
[1:36 AM] drzel: I’m in bed now but really appreciate the explanation. I’ll pore over it tomorrow
[4:36 AM] Spoike: oh, I'm sure gmqcc works well enough with DP, but you're not using DP.
[5:49 AM] Spoike: you could try changing your player_run line to if not(self.velocity_x || self.velocity_y) (the not there actually being hexenc syntax). I assume that'll be understood by gmqcc too, and should ensure both places use the exact same early-out logic (thus fixing the issue), as well as being a smidge faster (not that two opcodes difference is all that significant).
[5:49 AM] Spoike: but if you have any similar cases in your code, you'll have to find+fix those too.
[7:20 PM] drzel: Oh wow that's awesome, I'll look at that thanks @spoike
[9:26 PM] drzel: So just to clarify @spoike, you're saying that the reason the server is dying on mvdsv 0.32, but not 0.31 might be resolved by either:
compiling qwprogs.dat with frikqcc, or
changing if (!self.velocity_x && !self.velocity_y) to if not(self.velocity_x || self.velocity_y) and anywhere else that might end up with float && float?
The text was updated successfully, but these errors were encountered:
12:40 AM] drzel: hey @meag I'm really hoping to upgrade my server to 0.32 if possible, is there anything else I can do re: QW-Group/mvdsv#34 ?
GitHub
Server dying after about 90 seconds · Issue #34 · deurk/mvdsv
Hey I'm running 0.31 fine at qw://fortressone.ga Compiled 0.32 and swapped out the binary and the server crashes after about 90 seconds with: sv_error: Program error At least that's what I ...
[12:41 AM] meag: are you compiling it with the same flags etc as you compiled 0.31?
[1:16 AM] Spoike: @drzel which qcc are you using?
[1:18 AM] Spoike: I'm assuming its frikqcc
[1:21 AM] Spoike: frikqcc (when using -O3 or whatever it was) also enables a 'logic-ops' optimisation.
[1:21 AM] Spoike: this allows it to short-circuit conditionals in an attempt to avoid needing to evaluate expensive expressions (like function calls)
[1:23 AM] Spoike: it does this by using OP_IF/OP_IFNOT directly on the lhs of any && or || operators so that it can just skip over the logic needed for the rhs+dependant operations etc
[1:24 AM] Spoike: unfortunately, those two instructions expressely operate only on ints and not floats.
[1:25 AM] Spoike: this means that (-0.0 && -0.0) suddenly ends up considered as true, instead of false.(edited)
[1:26 AM] Spoike: bitwise, -0.0 == 0x80000000, so true
[1:27 AM] Spoike: unfortunately whether a float is 0 or not is more complicated than just testing the non-sign bits.
[1:28 AM] Spoike: not all cpus support denormalised floats for instance, and normally handle them as if they're 0 (this can be a potentially significant speedup for intel cpus for instance).
[1:29 AM] Spoike: so yeah, disable that optimisation or rewrite the qc so that it doesn't matter so much
[1:34 AM] drzel: Hrmmm honestly a lot of that has gone over my head. I’m compiling with gmqcc -std=gmqcc -fftepp @meag
[1:36 AM] drzel: I’m in bed now but really appreciate the explanation. I’ll pore over it tomorrow
[4:36 AM] Spoike: oh, I'm sure gmqcc works well enough with DP, but you're not using DP.
[5:49 AM] Spoike: you could try changing your player_run line to if not(self.velocity_x || self.velocity_y) (the not there actually being hexenc syntax). I assume that'll be understood by gmqcc too, and should ensure both places use the exact same early-out logic (thus fixing the issue), as well as being a smidge faster (not that two opcodes difference is all that significant).
[5:49 AM] Spoike: but if you have any similar cases in your code, you'll have to find+fix those too.
[7:20 PM] drzel: Oh wow that's awesome, I'll look at that thanks @spoike
[9:26 PM] drzel: So just to clarify @spoike, you're saying that the reason the server is dying on mvdsv 0.32, but not 0.31 might be resolved by either:
The text was updated successfully, but these errors were encountered: