Pierre Terdiman Profile Banner
Pierre Terdiman Profile
Pierre Terdiman

@PierreTerdiman

3,327
Followers
279
Following
1,659
Media
8,555
Statuses

Zurich, Switzerland
Joined November 2011
Don't wanna be here? Send us removal request.
Pinned Tweet
@PierreTerdiman
Pierre Terdiman
2 years
Do you know PEEL's PhysX edition ? This is scene 113 featuring a controllable Lego Technic Buggy made of rigid bodies and regular joints (no articulations). You can hide any of the parts to see the simulated mechanism underneath. Physics + Lego = 😍
7
32
258
@PierreTerdiman
Pierre Terdiman
3 years
"UFOs are just billionaires from other planets"
12
336
2K
@PierreTerdiman
Pierre Terdiman
11 months
Just saw this pattern used in a library and oh boy I don't like it.
Tweet media one
92
70
1K
@PierreTerdiman
Pierre Terdiman
6 years
Amateur: what's a coding standard? Junior: my 100 pages long standard covers everything and will be enforced. Advanced: my 2 pages standard is more like guidelines, please follow them. Senior: I have a strong sense of my own mortality and no time to waste on BS coding standards.
22
97
456
@PierreTerdiman
Pierre Terdiman
3 years
I am not easily shocked but that did it. Who knew "wave function collapse" code would be so much fun.
Tweet media one
34
53
417
@PierreTerdiman
Pierre Terdiman
1 year
C++ has reached a point where I cannot tell anymore if people's suggestions are serious or not. I was aware of the "don't use a debugger" crowd (as you might painfully remember from some time ago here) but the "don't use ctors" is a new one for me. 😅
@nickreal03
nickreal03
1 year
@PierreTerdiman You made two critical errors... 1. Use a constructor 2. Use '(' when creating new instances stead of '{'
2
0
16
25
25
401
@PierreTerdiman
Pierre Terdiman
9 months
The NovodeX SDK, which later became PhysX, will be 20 years old next February. I wrote half of that initial SDK (the collision / contact generation parts), Adam the other half (the dynamics / solver parts). Initially I thought it would be a temporary 1 year job or something...
Tweet media one
14
35
417
@PierreTerdiman
Pierre Terdiman
3 years
Tweet media one
4
57
372
@PierreTerdiman
Pierre Terdiman
4 years
Debug visualization of a PhysX AABB-tree being rebuilt over N frames. After N frames the switch to the new tree happens.
3
30
361
@PierreTerdiman
Pierre Terdiman
10 months
Unpopular opinion: "continue" and "break" are just "goto" with an implicit jump address left as an exercise for the readers. Sometimes the explicit jump target of "goto" can actually make the code flow easier to read.
60
16
371
@PierreTerdiman
Pierre Terdiman
1 year
Me: just export the raw data and load it somewhere else People: sounds too complicated, don't want to add another exporter library to the project Me: ...?! => People forgot the basics and over-complicate everything. The actual code you needed to add:
Tweet media one
13
19
341
@PierreTerdiman
Pierre Terdiman
11 months
Today I investigated a case where a 3.4 minutes pause was caused just by deallocating buffers. A lot of buffers. 1869021 buffers to be exact. Just in case you think memory allocations / deallocations are "free" 😭
25
25
325
@PierreTerdiman
Pierre Terdiman
4 years
My son is obsessed with Minecraft and watches Minecraft Youtube videos all the time. And now his favorite Youtuber reviewed Minecraft RTX and said "Thank you Nvidia!", and suddenly I'm a much cooler dad than yesterday I can tell you.
4
12
301
@PierreTerdiman
Pierre Terdiman
2 years
@ChrisGr93091552 @vzverovich Naaah the future is just: auto auto = auto; And then AI figures out everything.
3
2
298
@PierreTerdiman
Pierre Terdiman
5 years
Modern C++ is like academic research papers: an obfuscated way to write what often comes down to very simple code. But it has to look complicated otherwise it's not taken seriously.
8
56
278
@PierreTerdiman
Pierre Terdiman
2 years
Unless you're a C++ teacher, mastering C++ is not the goal. In itself, it provides no value to your customers. You don't *have* to use all the C++ features.
25
16
281
@PierreTerdiman
Pierre Terdiman
4 years
I used to think I was a "C++ programmer" but the more time passes, the more new features are added, the less this is correct. C++ is like the only language that you master less and less with time.
12
25
229
@PierreTerdiman
Pierre Terdiman
4 years
GPU fracture test. Same as what I posted on Twitter before but now on the GPU and with a higher quality video here:
2
15
233
@PierreTerdiman
Pierre Terdiman
1 year
"We're not bound by sanity" - great motto 😁
Tweet media one
3
31
229
@PierreTerdiman
Pierre Terdiman
1 year
Tweet media one
2
67
217
@PierreTerdiman
Pierre Terdiman
3 years
Here you go. Rendered in realtime in Nvidia's Omniverse Kit.
Tweet media one
Tweet media two
Tweet media three
8
28
212
@PierreTerdiman
Pierre Terdiman
2 years
Tweet media one
2
22
202
@PierreTerdiman
Pierre Terdiman
3 years
Fluid, Fracture, Fun
3
19
196
@PierreTerdiman
Pierre Terdiman
4 years
The real reason people don't do free & unlimited fracturing in games is because it creates an insane amount of rigid bodies from just a single cube. That's it. That's the reason.
10
17
190
@PierreTerdiman
Pierre Terdiman
3 years
On my side I added support for the lovely little "ramps" on the edges of cliffs (as seen in @OskSta 's version) but I'll need to limit these instances because it's completely out of control now :)
Tweet media one
Tweet media two
Tweet media three
Tweet media four
5
6
190
@PierreTerdiman
Pierre Terdiman
1 year
Reminder: Using 100% of all cores at all time does not imply the code is fast or optimized. e.g. somebody could very well be doing the same job in a fraction of the time with single-threaded code.
15
14
188
@PierreTerdiman
Pierre Terdiman
1 year
Python is a language that crashes on you at runtime if a block of *comments* is not properly indented. It's like somebody picked up the most asinine parts of a coding standard and made them hard requirements of the language just to maximize your misery using it. Worst. Ever.
Tweet media one
20
7
193
@PierreTerdiman
Pierre Terdiman
1 year
That mention of radix sort reminds me of an anecdote. Back in 1998 I was doing an internship at a small software company in Paris. I was the lowest-level junior guy in the team - unpaid work, mandatory stuff for an engineering school.
4
24
168
@PierreTerdiman
Pierre Terdiman
4 years
Another random fracture test from last year
1
4
153
@PierreTerdiman
Pierre Terdiman
2 years
This is what reading code that uses auto looks like to me.
Tweet media one
8
21
155
@PierreTerdiman
Pierre Terdiman
4 years
Since you guys seem to have an... appetite for destruction.... here's a variation on the usual rigid body box stack 😃
5
8
150
@PierreTerdiman
Pierre Terdiman
2 years
Speaking of meshes, PhysX 5 supports mesh-vs-mesh interactions via SDFs (a GPU-only feature for now). The emerging motion in the following test is entirely driven by collisions/contacts (not e.g. by a dedicated joint).
3
25
142
@PierreTerdiman
Pierre Terdiman
11 months
Started writing tweet about C++. Imagined the endless discussions this was going to generate. Canceled tweet. There, saved everybody a whole lot of time.
16
5
141
@PierreTerdiman
Pierre Terdiman
3 years
I am speechless.
Tweet media one
23
9
128
@PierreTerdiman
Pierre Terdiman
2 years
If you use a bleeding edge hot-off-the-press C++ feature in a team of 100, you are suddenly asking 100 potential readers of your code to learn a new feature just to keep up. This is already hard to justify. And if the benefits are debatable, the switch becomes a clear mistake.
11
12
131
@PierreTerdiman
Pierre Terdiman
11 months
Everything eventually becomes a hot path. I just write the fast API right from the start, it usually doesn't take much more time to write (at least from the API POV) and they are usually not "more difficult" to use - just different.
@BenSimsTech
Ben Sims
11 months
Kind of losing faith in Godot here. I've optimised ~10 commerical Unity projects and the methodology of prioritising easy to use APIs and then only making a performant version if/when enough people complain about it is completely wrong if you want to be a serious competitor.
40
12
173
7
15
128
@PierreTerdiman
Pierre Terdiman
2 years
Completely forgot about the procedural islands project. I must go back to this.
Tweet media one
Tweet media two
5
9
126
@PierreTerdiman
Pierre Terdiman
9 months
"O(1)" is not great when that's 1 big fat cache miss each time.
5
7
125
@PierreTerdiman
Pierre Terdiman
2 years
Debuggability is more important than readability. Because let's be honest, nobody will read your code unless they need to debug it :) So use slightly more lines of code and let me put a breakpoint into it please.
8
5
123
@PierreTerdiman
Pierre Terdiman
3 years
Sometimes I show people how to make the code run faster and they do admit it's faster (profile numbers are hard facts) but they can't start writing the code my way because it would be like switching religion or changing your political affiliation and they cannot no matter what.
9
6
109
@PierreTerdiman
Pierre Terdiman
2 years
"Code is read more often than it is written"... but it is also executed more often that it is read. Draw your own conclusions.
8
18
142
@PierreTerdiman
Pierre Terdiman
2 years
The same people saying they need range-based for to prevent off-by-one errors are advocating for using more modern C++ features. But honestly if I cannot trust you to write a basic for-loop without screwing up, how can I trust you with things like move semantics?
20
6
118
@PierreTerdiman
Pierre Terdiman
3 years
C++ is pessimistic, C is optimistic
Tweet media one
2
21
113
@PierreTerdiman
Pierre Terdiman
11 months
Like you wouldn't believe.
Tweet media one
Tweet media two
Tweet media three
@PierreTerdiman
Pierre Terdiman
11 months
@BMani Not really. It was a very different kind of programming.
4
0
15
9
9
116
@PierreTerdiman
Pierre Terdiman
2 years
I work with SIMD so I must be a 4x engineer at a minimum.
6
6
108
@PierreTerdiman
Pierre Terdiman
3 years
"Optimize the bottleneck" doesn't mean "only optimize the bottleneck". It means *start* your optimizations with the bottleneck. Job is not done just because you have a flat profile. Sometimes a flat profile means everything is equally bad.
2
16
102
@PierreTerdiman
Pierre Terdiman
5 years
School taught me about linked lists, the Amiga taught me about Copper lists, OpenGL taught me about display lists, but nobody told me that the future would me mainly about TODO lists.
2
12
99
@PierreTerdiman
Pierre Terdiman
2 years
Some users will be happy to hear that you can finally have "real" cylinders in PhysX, via PxCustomGeometry. See this PEEL test for example. In the second part the scene is raytraced via PxScene::raycast(), revealing the underlying shape.
3
17
96
@PierreTerdiman
Pierre Terdiman
4 years
I have a condition. I'm becoming allergic to modern C++.
6
7
86
@PierreTerdiman
Pierre Terdiman
3 years
Am I the only one using a Ctrl-Z / Ctrl-Y combo in MSVC to quickly navigate back to where I made the last edit?
29
1
89
@PierreTerdiman
Pierre Terdiman
10 months
Bumped into some remarkable code this week, that called some (non virtual) "getSingletonObject()" function a lot (instead of caching the result in a local var). The disassembly had 5 calls to this function in 20 lines of asm. Mad ratio. No, the compiler won't do it for you.
5
5
90
@PierreTerdiman
Pierre Terdiman
2 years
One of the PhysX team member was working from home in Kiev when the invasion started. In our last Teams meeting we asked him what he was going to do. His laconic one-word answer: "Fight". Then we were without news for a while. But we finally got news today that he's safe.
1
2
83
@PierreTerdiman
Pierre Terdiman
5 years
The more I look at modern C++, the more I miss 68000 assembly.
7
9
78
@PierreTerdiman
Pierre Terdiman
3 years
Just found my french graphics programmer nickname: Rastérix !
6
3
82
@PierreTerdiman
Pierre Terdiman
2 years
Monolithic "game engines" tend to make a lot of questionable technical decisions for me that I disagree with. Just give me a bunch of independent / separate 3rd party libraries that I can choose & stick together myself. Some "engines" are just wrappers around these anyway.
4
7
84
@PierreTerdiman
Pierre Terdiman
1 year
He'd been thinking about it the whole time and that was, I suspect, the moment he "got it". I remember it made me smile. That was a nice day.
2
0
86
@PierreTerdiman
Pierre Terdiman
1 year
Well this sucks.
Tweet media one
12
4
82
@PierreTerdiman
Pierre Terdiman
9 months
Used properly, the immediate mode API of PhysX can run quite a bit faster than regular PhysX (here for single-threaded performance). It basically gives you access to the low-level physics code - bypassing all the higher-level PhysX layers. Most users aren't even aware of it.
Tweet media one
1
8
86
@PierreTerdiman
Pierre Terdiman
3 years
I never posted a video of the PhysX (CPU) path-tracing snippet, only pictures. So here is one :)
2
4
83
@PierreTerdiman
Pierre Terdiman
8 years
"I don't use debuggers". Well thank you for coming, next candidate please.
11
19
68
@PierreTerdiman
Pierre Terdiman
11 months
Speaking of slow memory allocs, I spent my entire Atari ST life (and pretty much all my PC DOS life as well) blissfully unaware of "dynamic allocation", "malloc" or "free". Just put static buffers in the BSS section and manage/recycle that yourself.
7
3
82
@PierreTerdiman
Pierre Terdiman
5 years
People care too much about how the C++ source code looks like, and not enough about how the resulting assembly looks like.
7
7
76
@PierreTerdiman
Pierre Terdiman
2 years
Coding is fun, debugging sucks. I don't want a future AI that programs for me, I want a future AI that debugs for me.
6
4
79
@PierreTerdiman
Pierre Terdiman
2 years
People publicly admitting that they never/rarely use a debugger are scary. Imagine if they would build cars / planes / etc the way you build your software: "oh I just look at it and reason about it in my head to find what's wrong with it." I wouldn't trust that code.
17
9
77
@PierreTerdiman
Pierre Terdiman
1 year
You don't have to write optimized code all the time, but you should always write optimizable code.
4
3
79
@PierreTerdiman
Pierre Terdiman
2 years
Running un-optimized, single-threaded code on a modern PC is a bit like never putting your supercar in Sport or Race mode. Sure it's "safer" but you're missing out, and missing the point.
8
8
77
@PierreTerdiman
Pierre Terdiman
3 years
"Fast" code is not necessarily tricky or more difficult to read. Often it's just about helping the compiler, or at least checking it does what it should be doing. It can be super simple stuff, e.g. don't rely on it to move constant expressions out of loop: do it yourself.
1
18
77
@PierreTerdiman
Pierre Terdiman
11 months
Turns out a lot of graphics programmers have never heard of glenz vectors.
14
4
73
@PierreTerdiman
Pierre Terdiman
4 years
I think I don't trust super clean code. It's suspicious. Properly battle-tested code should have some scars to show. Kintsugi is the japanese art of repairing the cracks of broken pottery with gold, making them explicit. I want a Kintsugi codebase that tells me it survived war.
4
6
67
@PierreTerdiman
Pierre Terdiman
9 months
Newton's cradle in PhysX. This only works if you disable "persistent contacts", which is not possible through the regular API. This is only possible in immediate mode.
6
3
70
@PierreTerdiman
Pierre Terdiman
9 months
10 days of relentless "insignificant" optimizations later, that orange curve is now visibly lower than when I started.
Tweet media one
Tweet media two
1
2
69
@PierreTerdiman
Pierre Terdiman
6 years
Raytracing, RTX 2080, DXR, PhysX (just gathered my thoughts there instead of repeating myself N times on Twitter)
5
22
64
@PierreTerdiman
Pierre Terdiman
3 years
Slack: 3MB is too large! Also Slack: I'm using 7 GBs of ram LOL
Tweet media one
Tweet media two
2
7
63
@PierreTerdiman
Pierre Terdiman
3 years
The fact that engine X requires the latest compiler or uses C++17 is -not- a "feature". Show me something I care about, like e.g. how your editor opens in ~1s and doesn't use Gbs of ram just for an empty scene. Show me something you -couldn't- do in the past with older tech.
2
4
57
@PierreTerdiman
Pierre Terdiman
2 years
/fp:precise is lying to you, there is nothing precise about floating point math.
8
5
57
@PierreTerdiman
Pierre Terdiman
9 months
Immediate mode also means custom debug visualization is suddenly possible. Each group of contacts here has been computed by a different thread. Fun!
Tweet media one
0
4
57
@PierreTerdiman
Pierre Terdiman
10 months
So you have 2 versions of the code: 1. Initial version, super simple code, definitely the most "readable". 2. Optimized version that went through years of changes, much much much larger, definitely the most "unreadable", but also close to 100X faster. Which one do you keep?
58
2
56
@PierreTerdiman
Pierre Terdiman
3 years
Somebody proposed using template meta-programming to keep several lists of data in sync. An alarm rang in my head. So before you implement that, please remember this 20 y.o. low-tech alternative:
6
10
53
@PierreTerdiman
Pierre Terdiman
1 year
Later that day we both went home with the same metro. We hadn't talked much about the code. He was silent for a long time, with something on his mind. And then out of the blue, eyes wide open, it clicked: "wait, this sort doesn't even use comparisons!!!"
2
1
56
@PierreTerdiman
Pierre Terdiman
3 years
Following-up on previous tweets, here's an example of computing axis-aligned bounds around vertices without branches (minimal version). If you are using a scalar version with branches, consider comparing perf & disassembly to check if the compiler did that minimal job for you.
Tweet media one
4
7
54
@PierreTerdiman
Pierre Terdiman
11 months
Oh. That headset is touching the camera controls 🤦‍♂️
Tweet media one
2
4
55
@PierreTerdiman
Pierre Terdiman
4 years
Friday fun. Added a path-tracer PhysX snippet that traces rays through the new standalone PxBVH API (no need for PxScene etc). Kind of based on code from @aras_p and others online. Nothing new, just my turn to have fun with this. It's PT's PT! :)
Tweet media one
1
5
54
@PierreTerdiman
Pierre Terdiman
1 year
You didn't "clean up" the code, you modified it to fit your subjective and arbitrary cosmetic preferences.
8
2
53
@PierreTerdiman
Pierre Terdiman
4 years
Example: - new UE5 tech to draw billions of polys: yes please tell me more I want to learn! - new way to write for-loops in C++: I have better things to do with my life sorry nope. See? We have no problem with new tech per se :)
@PierreTerdiman
Pierre Terdiman
4 years
I think old people like me have no problem embracing new features & tech as long as they solve an actual problem. I'm personally baffled at the efforts put into "solving" for loops (with iterators, ranges, etc). It's a for loop. It's never been a "readability" issue or anything.
8
5
44
3
4
47
@PierreTerdiman
Pierre Terdiman
1 year
It's like I had shattered his world-view or something. It was interesting for me because it was my first exposure to a "real" job, to a serious company, and yet they didn't know what the demoscene had known for years. I had always suspected it. But this was confirming it.
1
0
53
@PierreTerdiman
Pierre Terdiman
1 year
I'm not using "old" C++, I'm using mature C++.
3
3
51
@PierreTerdiman
Pierre Terdiman
11 months
Maybe Elon secretly bought Unity.
2
7
50
@PierreTerdiman
Pierre Terdiman
3 years
It's a mistake to have just one "performance guy", you cannot expect one guy alone to clean up the mess from the whole team. Performance is a team effort. EVERYBODY should be "performance focused". No need to be OBSESSED with it, but a bit of it should be on everybody's mind.
@cmuratori
Casey Muratori
3 years
As a sidenote: it is insane that I am now referred to as "performance focused." If you'd told someone at RAD to "go talk to the performance guy", they would literally go to every other office _but_ mine. I was easily the least performance-focused person there!
11
4
356
5
4
51
@PierreTerdiman
Pierre Terdiman
4 years
Found in my basement...
Tweet media one
3
1
52
@PierreTerdiman
Pierre Terdiman
9 months
MSVC is drunk again.
Tweet media one
10
2
52
@PierreTerdiman
Pierre Terdiman
6 years
The asteroids demo I worked on a bit has finally been released:
3
11
48
@PierreTerdiman
Pierre Terdiman
3 years
Some C++ programmers think that: "it's written on a single line so it must be simpler/easier" I fundamentally disagree with this, and that might be the root of many arguments.
4
1
46
@PierreTerdiman
Pierre Terdiman
4 years
I think old people like me have no problem embracing new features & tech as long as they solve an actual problem. I'm personally baffled at the efforts put into "solving" for loops (with iterators, ranges, etc). It's a for loop. It's never been a "readability" issue or anything.
8
5
44
@PierreTerdiman
Pierre Terdiman
1 year
Except there was just a bug, of course. That I fixed. And then I ran the thing again. And this time it worked. And it was super fast. And the shock on that guy's face was priceless.
2
1
47
@PierreTerdiman
Pierre Terdiman
3 years
Extended WFC framework to triangular grids.
Tweet media one
2
4
44
@PierreTerdiman
Pierre Terdiman
10 years
1
34
45