sp614x / optifine

1.81k stars 418 forks source link

Optifine changes position diference by 1e-4 #5583

Open ghost opened 3 years ago

ghost commented 3 years ago

If the anticheat fails due to a position difference of 1e-4m (1mm), then it has some problems. It should have a tolerance for player actions that is well above 1mm, probably 10cm or something.

Originally posted by @sp614x in https://github.com/sp614x/optifine/issues/5578#issuecomment-823665612

'It should have a tolerance' So you want bypasses, inaccurate data from player and for more leniency from anticheats because some players might have fast math on?

FastMath returns invalid math.. imagine using a calculator in an exam, and you get an answer 0.0001 off... you'd throw it away. It isn't a small number at all.

It conflicts with almost every aspect of the game; elytras, world generation, movement. It gives an unfair advantage to players:

You completely ignore one of these issues by adding tooltip information... Might of well add a tutorial notification saying 'optifine might minimally change how you move'

Its not just 1.8, its every single version that is affected by fast math. Positions are different by 0.0001, sometimes up to 0.0002. As shown by the last video, it can affect gameplay as well. Its not just something to ignore, you cant jump 3 blocks without sprinting in vanilla, okay sure it can also slow them down at other angles, again not vanilla.

The audacity, to even say that it is 'an anticheat issue that it is too precise to a vanilla client' is just wrong, how about you make your modification that 90% of players use, be a cosmetic and performance only modification like its meant to be instead?

I hope you reconsider your stance and opinion, and I hope you choose to either fix the tables or remove fast math all together.

Tecnio commented 3 years ago

Got the same problems here my anticheat flags this and so as for some of my friends.

0-x-2-2 commented 3 years ago

How bad is your code quality that you cannot implement trivial edge cases for this? This is not the only mod that will have edge cases like this and won't be the last.

Solving simple problems like this in your anticheat should not be an issue and the vanilla game has many worse edge cases then this.

0-x-2-2 commented 3 years ago

Many worse problems then this come to mind that cannot be easily solved by users like how are you gonna solve the problem with defective cpus or differient architectures having more or less floating point precision?

See https://en.wikipedia.org/wiki/Pentium_FDIV_bug

Will you go to Mojang and cry for them to enable https://en.wikipedia.org/wiki/Strictfp instead of just finding a solution to the problem?

0-x-2-2 commented 3 years ago

You said it yourself if 90% of players use this modification then it would not matter because the mod is already released and many players won't update the mod for years sometimes.

In theory this feature in optifine should also make your anticheat "prediction" (copypasting mojang intellectual property btw) faster and it would be worth detecting it and switching over to it if 90% of players truly use this feature this would actually be an optimization.

0-x-2-2 commented 3 years ago

I however do agree with the elytra NaN bug needing to be fixed and limiting the fast sin/cos to only the renderer would probably also be fine because the game world tick in the client is a small part of what happens on the main thread in the client and this feature definitely should not be activated in singleplayer on the integrated server.

0-x-2-2 commented 3 years ago

Having the solution to this in your anticheat will not make it any easier to bypass it.

Tecnio commented 3 years ago

@0-x-2-2 Precision issues only effect so much 1E-8 to 1E-12 but 1E-4 is a big number and his code quality is not bad nor he has to compansate for edge cases this should not be a case in the first place an anticheat makes sure a player is on vanilla and enforces vanilla mechanics thats what an anticheat is you are completly wrong.

0-x-2-2 commented 3 years ago

@0-x-2-2 Precision issues only effect so much 1E-8 to 1E-12 but 1E-4 is a big number and his code quality is not bad nor he has to compansate for edge cases this should not be a case in the first place an anticheat makes sure a player is on vanilla and enforces vanilla mechanics thats what an anticheat is you are completly wrong.

The wikipedia example I have sent has the most common example/test of the intel floating point hardware cpu bug and the example of the bug shows it is wrong by 1e-4 so clearly you did not read it.

Janmm14 commented 3 years ago

@0-x-2-2 wrote:

Many worse problems then this come to mind that cannot be easily solved by users like how are you gonna solve the problem with defective cpus or differient architectures having more or less floating point precision?

See https://en.wikipedia.org/wiki/Pentium_FDIV_bug

Will you go to Mojang and cry for them to enable https://en.wikipedia.org/wiki/Strictfp instead of just finding a solution to the problem?

I think strictfp does not make any difference on any modern processor. I think modern processors are optimizerd for IEEE double calculations and not for something somewhat more precise, so strictfp shouldn't cause differences. And differences of strictfp are also less than E-8 or so. strictfp actually reduces the precision at most and does not increase it.

Also please learn how to properly link pages pls.

I still think that it'd be better if anticheats just handle this.If you truly believe that differences caused by fasthmath can give users any somehwat significant advantages, you should take a step back, relax, then take the time to implement optifine fastmath compat and then focus on killaura checks again. thanks

Tecnio commented 3 years ago

@0-x-2-2 wrote:

Many worse problems then this come to mind that cannot be easily solved by users like how are you gonna solve the problem with defective cpus or differient architectures having more or less floating point precision?

See https://en.wikipedia.org/wiki/Pentium_FDIV_bug

Will you go to Mojang and cry for them to enable https://en.wikipedia.org/wiki/Strictfp instead of just finding a solution to the problem?

I think strictfp does not make any difference on any modern processor. I think modern processors are optimizerd for IEEE double calculations and not for something somewhat more precise, so strictfp shouldn't cause differences. And differences of strictfp are also less than E-8 or so. strictfp actually reduces the precision at most and does not increase it.

Also please learn how to properly link pages pls.

I still think that it'd be better if anticheats just handle this.If you truly believe that differences caused by fasthmath can give users any somehwat significant advantages, you should take a step back, relax, then take the time to implement optifine fastmath compat and then focus on killaura checks again. thanks

Like I get what you actually mean but there are like so many popular mods and it shouldnt be the anticheat devs job to support them all. And FastMath doesnt even help with perfomance.

0-x-2-2 commented 3 years ago

Like I get what you actually mean but there are like so many popular mods and it shouldnt be the anticheat devs job to support them all. And FastMath doesnt even help with perfomance.

modification that 90% of players use

shouldnt be the anticheat devs job to support them

what one is it? this mod is already released and this feature has been in the mod for many years now it is already too late.

0-x-2-2 commented 3 years ago

I still think that it'd be better if anticheats just handle this.If you truly believe that differences caused by fasthmath can give users any somehwat significant advantages, you should take a step back, relax, then take the time to implement optifine fastmath compat and then focus on killaura checks again. thanks

I agree but anticheats should also not be depending on high levels of precision regardless especially with CPU from massively different new arches become popular like M1 (The only way to play minecraft with this cpu is with software that jit compiles x86_64 memory pages to arm64 and I have already seen edge case bugs with the jvm jit causing wrong results) and history shows that CPUs also are known to have rare edge case hardware bugs.

Allowing precision difference of 1e-4 should be perfectly fine and I do not see any cheats that would be able to abuse that at all but i seriously doubt optifine fastmath code will hurt performance and should only be few microseconds slower worse case per call.

0-x-2-2 commented 3 years ago

If this is about creating anticheat for parkour servers it is clearly trivial to detect FastMath already because your anticheat is already detecting it! You can just prevent those players from doing anything competitive but at this point it is already way too late to remove the feature when many players already have it enabled.

The people who are opening these issues just seem to like to complain because it looks like some of the people who have opened issues about this have opened issues in the past for ENTIRELY VANILLA FEATURES (also trivial to solve) conflicting with anticheat checks and thinking optifine added such features...

ghost commented 3 years ago

If this is about creating anticheat for parkour servers it is clearly trivial to detect FastMath already because your anticheat is already detecting it! You can just prevent those players from doing anything competitive but at this point it is already way too late to remove the feature when many players already have it enabled.

The people who are opening these issues just seem to like to complain because it looks like some of the people who have opened issues about this have opened issues in the past for ENTIRELY VANILLA FEATURES (also trivial to solve) conflicting with anticheat checks and thinking optifine added such features...

its not just about an anticheat though, more to do with the unfair advantages and modification to the vanilla game it does. fastmath code doesn't hurt performance but doesnt increase it. tell me where you can jump 3 blocks moving sideways without sprinting. tell me why it is banned in speedrunning if its a vanilla modification and doesn't impactfully change the game. Fastmath has no pros unless you're again running on a laptop made in 1995, the performance impact; almost 0. The negatives: affects world generation, changes how movement works. You cannot tell me that an fps gain of 0 on a 12 core CPU is much more needed than changing what positions are.

berkkrkc09 commented 3 years ago

Have some respect for the potato PCs. Not everyone have nice hardware. I've been using a dual core i5 for 5 years now and literally OptiFine makes it just playable.

Tecnio commented 3 years ago

Have some respect for the potato PCs. Not everyone have nice hardware. I've been using a dual core i5 for 5 years now and literally OptiFine makes it just playable.

I don't know what you are talking about we are saying fastmath has no performance impact.

0-x-2-2 commented 3 years ago

You cannot tell me that an fps gain of 0 on a 12 core CPU is much more needed than changing what positions are.

the average person has 4c4t if anything and considerable amount of people still use 2c2t cpus and not everyone has high end cpus with massive caches.

0-x-2-2 commented 3 years ago

tell me why it is banned in speedrunning

the reality is overclocking should be banned in speedrunning too and many other worse things because it is very easy to cause sometimes worse effects by causing bit flips in minecraft randomization.

mindforger commented 3 years ago

bitflips are mostly random, where a rounding error due to fastmath is (as example, but using another java runtime can also cause effects to happen) systematically ... which means it is reproduceable in an easy fashion ... speedrunners using glitches like accumulating fallspeed in other games because the glitch is systematically ... and if you know you'd have to move a t a specific angle so your speed is rounded up to the next digit instead of down this is seen as an abuse

but this is spiraling off topic here and also the reason why the original post was temporarily locked, so please return to topic before it happens again!

Janmm14 commented 1 year ago

1) Just check again with fastmath in your anticheat if regular check fails. 2) Lock players on detected fastmath setting while player is actively moving (until your detect like 10 ticks without active input, they could be in their settings and change it) 3) profit