Better HN
topnewbestaskshowjobs
Log inSign up

obl

1,695 karma · joined Aug 9, 2015 (11y ago) · 159 submissions

Submissions

1.

Leaving the Sea of Nodes in the V8 JIT(v8.dev ↗)

20 points · by obl · 6mo ago · 2 comments

comment 1y ago · link · parent

It is not ridiculous at all. Those things have pretty precise definitions and type segregation absolutely does remove a bunch of soundness issues related to type confusion.

You can think of it as the rather classic "Vec of struct + numeric IDs" that is used a lot e.g. in Rust to represent complex graph-like structures.

This combined with bound checking is absolutely memory safe. It has a bunch of correctness issue that can arise due to index confusion but those are not safety issues. When combined with some kind of generational counters those correctness issue also go away but are only caught at runtime not at compile time (and they incur a runtime cost).

Rust's memory safety is about avoiding liveness issues (that become type confusions since all memory allocators will reuse memory for different types), nothing more, nothing less.

3.

The Elusive Frame Timing(medium.com ↗)

2 points · by obl · 2y ago · discuss

4.

2024 EuroLLVM – How Slow Is MLIR [video](youtube.com ↗)

1 points · by obl · 2y ago · discuss

5.

Maya as Editor: The game development approach of Santa Monica Studio [video](youtube.com ↗)

1 points · by obl · 2y ago · discuss

comment 2y ago · link · parent

Weird that this treats uninitialized variables as unknown values. For example in ex3.c, the program

  int main(){
      int x;
      if (x <= 42){
              assert(x != 12345);
      }
  }
is of course UB in C, even though under a "uninitialized is random" model the program is valid and does not assert (as the model checker concludes).

(even in O1 clang gets rid of the whole function, including even the ret instruction, I'm surprised it does not at least leave an ud2 for an empty function to help debugging since it would not cost anything https://godbolt.org/z/eK8cz3EPe )

7.

Parallel Query Systems: Demand-Driven Incremental Compilers [pdf](diva-portal.org ↗)

1 points · by obl · 2y ago · discuss

8.

2023 LLVM Dev Meetingg – Mojo: A system programming language [video](youtube.com ↗)

2 points · by obl · 3y ago · discuss

9.

eBPF: Unlocking the Kernel [Official Documentary] [video](youtube.com ↗)

1 points · by obl · 3y ago · discuss

10.

LLVM: Scalar Evolution (SCEV)(npopov.com ↗)

1 points · by obl · 3y ago · discuss

11.

Unreal Engine 5: Nanite deep dive [pdf](advances.realtimerendering.com ↗)

5 points · by obl · 3y ago · discuss

12.

Chasing the Myth of Zero-Overhead Memory Safety(verdagon.dev ↗)

4 points · by obl · 3y ago · 1 comment

13.

A CPU research kernel for cycle-by-cycle micro-architectural introspection(gamozolabs.github.io ↗)

5 points · by obl · 3y ago · discuss

comment 3y ago · link · parent

This is memory safe if you never re-use a (generational index, address) pair.

They seem to use 64 bit ones so this means that to overflow a single memory cell you would have to allocate and free it every cycle (!) at 4 ghz for about 150 years.

Basically as long as you accept this incredibly small "memory leak" you're fine.

15.

From Stacks to Trees: A new aliasing model for Rust(ralfj.de ↗)

191 points · by obl · 3y ago · 42 comments

16.

V8 Maglev: compiler design doc(docs.google.com ↗)

49 points · by obl · 3y ago · 17 comments

comment 3y ago · link · parent

Actual clipping is expensive so indeed a "guard band" is used : inside the region allowed by the internal precision of the rasterizer, outside pixels are simply "ignored".

See e.g. https://fgiesen.wordpress.com/2011/07/05/a-trip-through-the-... for a nice detailed explanation.

comment 3y ago · link · parent

It would be interesting to see how you were testing for that, because at least on AMD it's fairly certain that a single thread can be shading multiple primitives.

For example, from the ISA docs [1], pixel waves are preloaded with an SGPR containing a bit mask indicating just that :

> The new_prim_mask is a 15-bit mask with one bit per quad; a one in this mask indicates that this quad begins a new primitive, a zero indicates it uses the same primitive as the previous quad. The mask is 15 bits, not 16, since the first quad in a wavefront begins a new primitive and so it is not included in the mask

The mask is used by the interp instructions to load the correct interpolants from local memory.

In fact, in the (older) GCN3 docs [2] there is a diagram showing the memory layout of attributes from multiple primitives for a single wavefront (page 99).

That being said, of course I expect this process to be "lazy" : you would not want to buffer execution of a partially filled thread forever, so depending on the workload you might measure different things.

[1] https://developer.amd.com/wp-content/resources/RDNA2_Shader_...

[2] http://developer.amd.com/wordpress/media/2013/12/AMD_GCN3_In...

comment 3y ago · link · parent

  In actual hardware shading is done 32 or 64 pixels at a time, not four. The problem above just got worse.
While it's true that there are "wasted" execution in 2x2 quads for derivative computation, it's absolutely not the case that all lanes of a hardware thread (warp / wavefront) have to come from the same triangle. That would be insanely inefficient.

I dont think that it's publicly documented how the "packing" of quads into lanes is done in the rasterizer for modern GPUs. I'd guess something opportunistic (maybe per tile) taking advantage of the general spatial coherency of triangles in mesh order.

20.

Ownership You Can Count on [pdf](inko-lang.org ↗)

2 points · by obl · 3y ago · discuss

21.

A new runtime for Nim (2019)(nim-lang.org ↗)

2 points · by obl · 3y ago · discuss

22.

Semantic Subtyping in Luau(blog.roblox.com ↗)

2 points · by obl · 3y ago · discuss

comment 4y ago · link · parent

If you didn't already, I'd recommend compiling llvm/clang in debug or release+assert mode when working on it. The codebase is quite heavy in debug-only assertions even for relatively trivial things (like missing implementation of some case, some combination of arguments being invalid, ...) which means that it's pretty easy to get into weird crashes down the line with assertions disabled.

24.

SSA Translation is an Abstract Interpretation [pdf](binsec.github.io ↗)

1 points · by obl · 4y ago · discuss

25.

A Decade Verifying LLVM, or How to Retrofit Soundness in Industrial Software(youtube.com ↗)

2 points · by obl · 4y ago · discuss

26.

Const Syntax in Rust(blog.yoshuawuyts.com ↗)

1 points · by obl · 4y ago · discuss

27.

Carbon’s most exciting feature is its calling convention(foonathan.net ↗)

243 points · by obl · 4y ago · 217 comments

comment 4y ago · link · parent

Wait, I'm pretty sure operand collection logic & banking is there to keep the number of ports on the SRAM low, so basically you're arbitrating and buffering requests coming from high register count instructions (say 3 input fma) and potentially multiple pipelined SMT threads (not thread in the nvidia sense, thread in the "a whole wavefront/warp" sense).

However to me it seems that's completely orthogonal to the vector lanes : I don't see why two parallel lanes in a single thread (eg a 64-element GCN wavefront) would need cross-connected logic at the register file, since almost all instructions _do not_ read/write data from another lane.

There are a few cross-lane shuffles / reduce instruction but it seems to me that those would be handled in a dedicated execution unit. (they are not really the fast-path/common case)

29.

Make Your Own Chips for Free(efabless.com ↗)

127 points · by obl · 4y ago · 92 comments

30.

The B3 JIT Compiler (2016)(webkit.org ↗)

1 points · by obl · 4y ago · discuss

123456