Simplex

19.6K posts

Simplex banner
Simplex

Simplex

@simplex_fx

AAA gamedev for 15+y (ex-Crytek). Automotive stuff. CNCing old turret lathes. Writing a game in C. Father. Catholic. Swordsman/stunt.

Sukoró, Magyarország Katılım Şubat 2013
583 Takip Edilen1.9K Takipçiler
Sabitlenmiş Tweet
Simplex
Simplex@simplex_fx·
Profiling & Optimization Expectation: -clever algorithms -SoA -hand-written SIMD Reality: -rewriting totally retarded stuff that makes no sense and either quadratic or exponential -removing unneccessary abstraction and polymorphism -adding reserve() / resize() -removing Log()
English
5
20
252
0
Simplex
Simplex@simplex_fx·
@soymoduh not like I literally do this for a living, or something
English
1
0
0
8
Simplex
Simplex@simplex_fx·
if you consider basic bit operations like idx & map "obfuscating", you shouldn't go near C or C++ or any kind of system / perf / embedded / mission critical code. I assume you piss on your legs when you see a "De Bruijn" bitscan or a Q_rqsrt
Svetlin Totev@SvetlinTotev

@simplex_fx So your solution to the performance problem of comparing two numbers and doing a conditional branch that only happens when there is a catastrophic bug is to: - Double the operations, memory loads, cache lines, code length, memory used; - force 2^n array sizes; - obfuscate logic.

English
7
0
55
6.4K
ashrealite
ashrealite@ashrealite·
@simplex_fx @SvetlinTotev from my testing, the generated code is around 15% slower if the array is not pow2 and you are doing modulo, because it generates constant division optimization for that operation which is basically a wide mul, shift(sometimes with add), a mul and sub, and that's constant
English
1
0
0
9
Simplex
Simplex@simplex_fx·
@soymoduh I mean your imagination about branchless programming, fucktard.
English
1
0
0
15
Simplex
Simplex@simplex_fx·
@soymoduh no, you can multiply with !error or !!error or you can index into an array with it, switch between stdout/stderr, whatever else.
English
1
0
0
21
stop saying “bayesian”
@simplex_fx This is genuinely, actually the most retarded thing I have ever seen on this platform. No, no serious team lead will let you merge code that behaves in functionally random ways when there is an error. I hope to god that you never actually pick up C.
English
2
0
0
25
Svetlin Totev
Svetlin Totev@SvetlinTotev·
@simplex_fx @Dark_Goldenrod Your reply is completely unrelated to what I said because you don't actually know or understand anything. You just misuse interesting looking one-liners because they make you feel smart. You will not learn and you will not get better until you realise you are like this.
English
1
0
0
18
Svetlin Totev
Svetlin Totev@SvetlinTotev·
@dollmanipulator @simplex_fx The expected number of mispredicts is 0 because you are checking something that will never happen. Also my point is that the OOB should be handled correctly and never completely bypassed. And this can be done without a check at every calculation.
English
1
0
0
58
ashrealite
ashrealite@ashrealite·
@SvetlinTotev @simplex_fx Btw, you don't even need to limit it to pow2, because the compilers are smart. For example modulo the size of the array would optimize down into some constant time ops as well and prevent the branch allowing SIMD. Pow2 size just guarantees that op is a simple as a bitwise &.
English
2
0
0
15
Svetlin Totev
Svetlin Totev@SvetlinTotev·
@Dark_Goldenrod @simplex_fx In a hashmap, every key is valid. In an array, only some idx are valid. Also the memory allocations are designed around being able to use the lower bits of the hash directly. So this idea doesn't work in general for arrays both because of the size problem and the idx problem.
English
2
0
0
52
Simplex
Simplex@simplex_fx·
@P88044770 formatting strings on embedded hw is not ;)
English
1
0
0
14
Simplex
Simplex@simplex_fx·
@int_16h could you elaborate on the "make sure" part? ;)
English
1
0
1
63
INT 16H
INT 16H@int_16h·
I’m more of a just “do not check” guy. Like, really, we want to make sure that index is never out of bounds, like provably not possible. And then do not check. If that is not feasible, like data from disk, user input, etc. then you must check and abort if fails, so branch is unavoidable. Using mask is retarded.
English
2
0
2
95
NOTimothyLottes
NOTimothyLottes@NOTimothyLottes·
@simplex_fx Gameplay on the GPU. Completely get rid of the CPU pipeline stage. As a one man show Im not building linear play-through content with scripted interaction. All those game design methods that only scale by hiring count won’t work.
English
2
0
1
80
NOTimothyLottes
NOTimothyLottes@NOTimothyLottes·
Game devs folks, just a suggestion, if you want the kind of master that keeps buying studios to kill them off, and ratchets in 1984 each year on your PC, then by all means keep doing DirectX and Win84 as your primary dev platform.
English
13
5
119
11.7K
Simplex
Simplex@simplex_fx·
@SvetlinTotev if you consider basic bit operations obfuscating, you shouldn't go near C or C++ or any kind of system / perf / embedded / mission critical code
English
1
0
2
527
Svetlin Totev
Svetlin Totev@SvetlinTotev·
@simplex_fx So your solution to the performance problem of comparing two numbers and doing a conditional branch that only happens when there is a catastrophic bug is to: - Double the operations, memory loads, cache lines, code length, memory used; - force 2^n array sizes; - obfuscate logic.
English
2
0
5
7.2K
Simplex
Simplex@simplex_fx·
@P88044770 why don't you already have this infrastructure for logging?
English
1
0
0
18
Syntaxxed
Syntaxxed@P88044770·
@simplex_fx Temporary debugging prints shouldn't need such infrastructure. I'm talking about a handful of lines being output.
English
1
0
0
13
NOTimothyLottes
NOTimothyLottes@NOTimothyLottes·
@simplex_fx More like I have majority of code on the GPU in shader land, so live edit/test, and everything bound in all dispatches, so I can build visualizer tools like say a scope, and just write data to the source buffer at any point in time from any shader.
English
1
0
2
54