Better HN
topnewbestaskshowjobs
Log inSign up

ColonelPhantom

645 karma · joined Oct 28, 2016 (10y ago) · 374 submissions

Submissions

comment 4y ago · link · parent

The README has "Use Rust for new features" in it, so I doubt it will retain the same simplicity.

As much as I like Rust, and despite mixing Rust and C++ being the clear path forward for Mozilla, I'm not so sure it's the winning approach here. Part of the beauty of SQLite is the single .c/.h thing.

That said, I can see that maybe they're trying to expand the use cases of libsql compared to SQLite. That seems to be the whole idea with adding support for e.g. distributed databases, which is something SQLite just doesn't bother with at all, and would introduce a ton of external interfacing regarding networking. SQLite uses only the standard C library, and even then barely scratches its surface.

Also, SQLite's VFS API can do a lot there already. For example, I remember seeing SQLite compiled to WASM, using a VFS that downloads a remote database on S3 using HTTP Range requests. (I don't think it supported writing to the database, but it was still a really cool way of allowing complex client-side querying of a dataset that is static but too big to transfer).

comment 4y ago · link · parent

I think wxWidgets was pretty big in the 2000's, with quite some programs using it. To name one example, the Code::Blocks IDE uses it.

FLTK has never seen adoption even to the level of wxWidgets I think, but to be honest it is also quite simply hideous. I have not found a proper looking theme for it either, since I was mildly interested in using it to add a simple GUI to a Rust tool.

comment 4y ago · link · parent

Video acceleration and rendering acceleration are both mainstream.

On Chrome, open chrome://gpu which will tell you various things about its use of your GPU.

I'm not aware of an equivalent page for Firefox but opening about:support should somewhere inform you of the compositor, which when it says "WebRender" also makes use of your GPU.

comment 4y ago · link · parent

The iOS situation is closer to Subway forbidding me from taking my food home and putting McDonald's sauce on it, even though I bought the damn sandwich.

comment 4y ago · link · parent

The nice part of HIP is that it's essentially CUDA. So it's very easy to migrate (and presumably also migrate back; though I believe HIP for NVIDIA is just a simple header that maps HIP constructs to the same CUDA construct using #define anyway).

Also, my RX 580 is not officially supported, and doesn't work in Blender either (even when trying to compile it myself, as I got a compiler error related to LLVM limitations), but developing things myself seems to mostly just work so far. I also managed to port LeelaChessZero from the cuBLAS backend to hipBLAS without noteworthy problems (and gained a fair bit of speed over the OpenCL backend). (I still want to try and get it working with hipDNN, which I threw out at my first port attempt because hipify-clang got confused over various #IFDEFs but hipify-perl does not seem to have that issue).

Installing also hasn't been too bad for me on Arch Linux, I just installed an AUR package that pulls in most of AMD's binary packages (opencl-amd-dev) and now I have working hipcc and all that in /opt/rocm/.

I do agree that the situation could be far better, but if I can take a fairly simple CUDA app and port it in an afternoon to work on my consumer GPU, I don't think the situation is completely terrible either.

Also, as for various stacks, Close to Metal is very long ago. I've honestly never heard of Brook+ or Stream Computing. As for the others, I think AMD APP, HSA, ROCm, HIP and AOMP are all sort of part of the same stack. For example, my OpenCL driver which I believe is part of the ROCm stack identifies as AMD-APP. HIP and AOMP are then both like compiler frontends for the ROCm compute stack.

For the any-GPU any-OS SPIR-V wish, Vulkan or OpenCL are probably your best bet, although that won't meet "any framework".

comment 4y ago · link · parent

There's honestly barely an OpenCL ecosystem to speak of. Even Blender abandoned it.

Also, at least with CUDA and HIP, you need to manually malloc GPU memory, and explicitly launch GPU kernels (using <<<>>> syntax for CUDA or optionally hipLaunchKernel for HIP).

Ecosystem is the main problem of anything not CUDA or sort-of compatible like HIP. A ton production GPGPU code uses CUDA.

comment 4y ago · link · parent

That's what I mean by "should be able to do with it whatever you want" :)

comment 4y ago · link · parent

ROCm support can be kind of a joke, but Blender demonstrates its best side: it works on all consumer GPUs Vega and newer (no Polaris unfortunately), and on Windows.

That said, the build instructions for Blender say that you can't compile the GPU program on Windows. (I am not sure how this works exactly with JIT vs AOT compilation.)

AMD itself isn't working on SYCL to my knowledge, but you may be interested in hipSYCL which can compile SYCL code to HIP or CUDA. CUDA/HIP does have the advantage of a massive library of existing code and knowledge, and pre-existing libraries (e.g. cuPRIM, cuBLAS, etc) which you do not have on SYCL.

I also believe AMD has AOMP for OpenMP offload.

I do agree that AMD and Intel would be best off working together on GPU compute, so that they can say "look, our approach works on ALL vendors, not just us". However if Intel supports HIP on oneAPI, and maybe hipSYCL gets some sort of official support, we will be there already with both of their solutions.

comment 4y ago · link · parent

The main advantage of approaches like CUDA and SYCL is that host code and device code are written in the same language. That makes it easier to e.g. deal with custom structs.

Also, I don't buy that C99 is that much closer to the metal than C++17. From what I've seen, a lot of code still uses C-style anyway (e.g. C arrays). C++ just adds some nice stuff like namespaces. (I think a lot of the standard library would not work GPU-side anyway, at least with CUDA/HIP.)

comment 4y ago · link · parent

I don't think any GPU vendors really back OpenCL anymore. I honestly doubt it will see much if any growth in the future.

Of course, the most used stack is currently CUDA, which is proprietary and only works on Nvidia.

AMD made its own version called HIP, which translates quite directly to CUDA, but also runs on AMD cards via ROCm.

Intel has its own stack called oneAPI, which I think is based on SYCL, a Khronos standard (just like OpenCL/OpenGL/Vulkan/etc). I believe SYCL programs can also be ran on AMD and NVIDIA using third-party compilers/translation tools such as hipSYCL, and I think SYCL can also be compiled to OpenCL.

I recently also heard about efforts to support running HIP programs on SYCL, so hopefully soon GPU compute will be less vendor-bound, with CUDA translating relatively easily to HIP, and HIP and SYCL also not offering compatibility problems either way.

comment 4y ago · link · parent

That's not actually required for free software (as in freedom), but once you buy you need to get the source as well, and should be able to do with it whatever you want.

E.g. the GPL mandates not "you will make the source freely available", it mandates "you will make the source available to everyone who receives the software".

Furthermore, the Document Foundation will still be offering free downloads of LO for macOS, they just add another way of getting it that does cost money.

comment 4y ago · link · parent

I have a slider for touchpad scroll speed on my KDE Plasma Wayland laptop.

Also, in my experience XWayland programs seem to exhibit overly sensitive scrolling, while native Wayland is fine (noticed this mainly on Firefox). Perhaps X scrolls by line, while Wayland natively supports pixel-based scrolling?

comment 4y ago · link · parent

XWayland already exists and is the name for X.org running on Wayland, to enable X11 apps to run on Wayland desktops.

You may be interested to learn about wl-roots though. It's a project that I think originated from sway, and it aims to provide most of the low-level plumbing for writing your own Wayland window manager/desktop environment.

comment 4y ago · link · parent

Golden Cove (Alder Lake) has been a massive uplift in performance-per-clock from the previous generations. This is also related to the fact that Intel was reiterating Skylake for most of the time until ADL, which itself is barely more than Sandy Bridge with a few generations of iterative tweaks. I believe Raptor Cove (what will be in 13th gen) is not that big of a change from Alder Lake; it's the same but with some refinements and mainly larger caches.

Furthermore, the P-core/E-core divide means that they can make the P-cores quite large and inefficient, as E-cores will pick up the heavily-threaded tasks. So while a Zen core is significantly smaller than a Golden Cove core, Gracemont is much smaller still.

comment 4y ago · link · parent

RISC-V is very flexible, yes, but most 'desktop-class'/application processors are expected to implement at least RV64GC. G is short for IMAFD, so mul/div, atomics, and floating point are all in there, as well as compressed instructions (C) to reduce code size.

Other features you're likely to want are also included in the specification, so if you want to write code that uses for example the B bit manipulation extension or the V vector extension (which is scalable with vector width as well, unlike SSE/AVX) you just have to check a standardized 'CPUID' bit and can run your code, and otherwise fall back to other code.

I also believe that the spec may let operating systems hook these instructions and provide fallbacks so application developers don't have to, but I'm not too sure on the specifics of the privileged ISA of RISC-V.

comment 4y ago · link · parent

If you select the correct connection in virt-manager (iirc it's called something like "libvirt (User session)") then you will see your Boxes VMs, and vice versa a VM created under that connection will appear in Boxes.

Doesn't solve remote issues, but can still be useful if you want to e.g. set some advanced options for a Boxes VM.

comment 4y ago · link · parent

RISC-V is pretty interesting in this regard; it uses weak memory ordering by default, but a CPU that implements TSO can simply flag Ztso, and I believe that would be enough to get x86-like memory semantics.

IIRC, Apple M1 uses a similar technique to make sure Rosetta 2 can run translated x86 code without worrying about the memory model. However, M1's implementation can be switched at runtime, while Ztso is not. On the other hand, Ztso is standardized while M1's TSO is not.

Also, the text for Ztso mentions that SPARC uses TSO, just like x86. ARM however is indeed more relaxed.

comment 4y ago · link · parent

Both approaches have virtues. HLS is simpler for software programmers, but tends to rely more on 'magic' and is not a very clean abstraction of the hardware that's generated.

That said, loops aside, most compiler IR is a sort of dataflow graph which could reasonably be synthesized into hardware. But most control flow does not map very well.

Higher-level HDLs such as Chisel (although I have never used it) instead abstract directly over standard HDLs like Verilog or VHDL. These abstractions are simpler because they do not alter the fundamental design ideas; they just offer increased flexibility (for example VexRiscv, which is written in SpinalHDL and has most functionality in 'plugins' which extend CPU components, which is a very powerful form of metaprogramming that is not possible with Verilog).

If your issue is with Scala, there's other HHDLs such as Clash (based on Haskell) or Migen and Amaranth which use Python.

comment 4y ago · link · parent

I just installed ImHex, and I saw an option to attach to a GDB server. I assume that implies memory editing capabilities, but I haven't tried it yet.

I also don't know how the situation would be on non-GNU platforms, although I think GDB is a thing on Windows with MinGW?

comment 4y ago · link · parent

That said, a lot of communities seem to be migrating to Discord as well, which has a discoverability many times worse than forums, as Discord 'servers' are not even publicly accessible.

comment 4y ago · link · parent

So that you can write "primitives" such as a queue in unsafe, and assuming it is correct, it is not possible to introduce bugs from other code.

Also, things like queues tend to be implemented in either the stdlib or a very popular library. So they are very well tested and likely to be widely reviewed.

comment 4y ago · link · parent

A hypertext approach such as HTMX in fact does give you server rendering, since you send to the client a normal SSR page with some extra annotations that add SPA features.

For React, SSR is secondary. For HTMX, it is primary.

comment 4y ago · link · parent

The idea of HTMX is to mostly eliminate JS, and move everything into either HTML or the server. It's kind of like old fashioned <form>s, but for all elements and for more dynamic pages.

This allows the frontend to be simpler, while the backend is ironically also less complex because the only special feature you need is support for sending partial HTML (fragments). This as opposed to needing to embed your entire frontend framework in your backend to allow your website to load in a reasonable time, run in browsers with JS disabled, be easier to crawl, etc.

That said, do you have a link to your frontend framework? I always enjoy seeing different approaches to the same or similar problems.

comment 4y ago · link · parent

The blog post is about writing a Vulkan driver inside Mesa. Nvidia's blob driver does not count here.

comment 4y ago · link · parent

Ah, you mean the mobile web version. I agree, that is an absolute dumpster fire that looks like it hasn't been updated since 2009.

Not sure why though, probably just lack of interest from Google.

comment 4y ago · link · parent

Rust is actually right, you cannot have multiple mutable references to a Database object without things going down the drain. (This is related to the fact that, like other comments said, &mut is an exclusive reference).

However, achieving something like what you want is still more than possible in Rust. You can do this with the pattern of 'interior mutability', which in its simplest form is just a Mutex. This allows upgrading a shared reference to an exclusive reference, so that you can safely mutate an object while upholding the expectations that a mutable reference is exclusive, and a non-mutable reference does not change from under your feet.

Of course, for a database, you will probably want a more advanced implementation of interior mutability, so that you can commit multiple transactions at the same time. (Or not, it seems to work quite well for SQLite.)

comment 4y ago · link · parent

They mean that in unsafe code, you have to adhere to some rules to prevent safe code from becoming unsafe.

In other words, incorrect code in "unsafe Rust" can cause safety issues that only appear when you use it in a certain way from "safe Rust".

comment 4y ago · link · parent

Gmail's web app is "extremely poor"? I almost never experience any issues with it, and it's quite streamlined in my experience. It's not worse than the Android app (it's actually nicer, IMO, but that's probably in large part because it's on a big screen). It could be more responsive, but that's about it.

comment 4y ago · link · parent

By cache, I assume the writer means disk cache. Disks are slow! (Yes, even your PCIe 4.0 x4 NVMe SSD is.) So the kernel (usually) uses RAM to cache reads and writes. (This can be bypassed, but let's ignore that.) Under heavy disk IO, using fast RAM for this cache is more beneficial than reserving it on behalf of a program that may use it very rarely, or maybe even not at all (in the case of memory leaks)!

If on a hypothetical 8GiB RAM system, programs require 6 but 2 of those are rarely used, there is no memory contention but the extra space for disk cache is still a helpful boost.

I do think program memory is more valuable on most desktop systems, since commonly memory access is expected to be fast while disk access is expected to be slow. This means that interactive software tends to mitigate for slow IO, while it can't do much against being swapped out.

On servers however I'd probably rather let the kernel do its job (at least if I'm focusing on throughput), unexpected slowness may worsen a worst case but the average case is helped enough.

Luckily, the Linux kernel, for all of its memory management flaws (don't get me started on overcommit), allows configuring this using the vm.swappiness parameter that tells it what to prioritize.

1
910111213