Readit News logoReadit News

Deleted Comment

mymoomin commented on “A calculator app? Anyone could make that”   chadnauseam.com/coding/ra... · Posted by u/pie_flavor
mananaysiempre · 6 months ago
For all real numbers in bulk— You may call it a diagonal argument, but it’s just a reduction to Cantor’s original statement, no new proof needed. There are only countably many computable numbers, because there are only countably many programs, because there are only countably many finite strings over any finite alphabet[1].

For individual real numbers— There are of course provably uncomputable ones. Chaitin’s constant is the poster child of these, but you could just take a map of (number of Turing machine in any numbering of all of them) to (terminates or not) and call that a binary fraction. (This is actually not far away from Chaitin’s constant, but the actual one is reweighted a bit to make it more meaningful.) Are there unprovably uncomputable ones? At a guess I’d say so, but I’m not good enough to give a construction offhand.

[1] A countable union of (finite or) countable sets is finite. Rahzrengr gur havba nf sbyybjf: svefg vgrz bs svefg frg; frpbaq vgrz bs svefg frg, svefg vgrz bs frpbaq frg; guveq vgrz bs svefg frg, frpbaq vgrz bs frpbaq frg, svefg vgrz bs guveq frg; rgp. Vg’f snveyl boivbhf gung guvf jbexf, ohg vs lbh jnag gb jevgr gur vairefr znccvat rkcyvpvgyl lbh pna qenj guvf nf n yvar guebhtu gur vagrtre cbvagf bs n dhnqenag.

mymoomin · 6 months ago
You have a typo in [1]. It should read "A countable union of (finite or) countable sets is countable."
mymoomin commented on Don't "optimize" conditional moves in shaders with mix()+step()   iquilezles.org/articles/g... · Posted by u/romes
TeMPOraL · 7 months ago
EDIT: I see my source of confusion must be that "branch" must have a well-understood hardware-specific meaning that goes beyond the meaning I grew up with, which is that a conditional is a branch, because the path control takes (at the machine code level) is chosen at runtime. This makes a conditional jump a branch by definition.

> How are we supposed to know what OpenGL functions are emulated rather than calling GPU primitives?

To me the problem was obvious, but then again I'm having trouble with both your and author's statements about it.

The problem I saw was, obviously by going for a step() function, people aren't turning logic into arithmetic, they're just hiding logic in a library function call. Just because step() is a built-in or something you'd find used in mathematical paper doesn't mean anything; the definition of step() in mathematics is literally a conditional too.

Now, the way to optimize it properly to have no conditionals, is you have to take a continuous function that resembles your desired outcome (which in the problem in question isn't step() but the thing it was used for!), and tune its parameters to get as close as it can to your target. I.e. typically you'd pick some polynomial and run the standard iterative approximation on it. Then you'd just have an f(x) that has no branching, just a bunch of extra additions and multiplications and some "weirdly specific" constants.

Where I don't get the author is in insisting that conditional move isn't "branching". I don't see how that would be except in some special cases, where lack of branching is well-known but very special implementation detail - like where the author says:

> also note that the abs() call does not become a GPU instruction and instead becomes an instruction modifier, which is free.

That's because we standardized on two's complement representation for ints, which has the convenient quality of isolating sign as the most significant bit, and for floats the representation (IEEE-754) was just straight up designed to achieve the same. So in both cases, abs() boils down to unconditionally setting the most significant bit to 0 - or, equivalently, masking it off for the instruction that's reading it.

step() isn't like that, nor any other arbitrary ternary operation construct, and nor is - as far as I know - a conditional move instruction.

As for where I don't get 'ttoinou:

> How are we supposed to know what OpenGL functions are emulated rather than calling GPU primitives

The basics like abs() and sqrt() and basic trigonometry are standard knowledge, the rest... does it even matter? step() obviously has to branch somewhere; whether you do it yourself, let a library do it, or let the hardware do it, shouldn't change the fundamental nature.

mymoomin · 7 months ago
A "branch" here is a conditional jump. This has the issues the article mentions, which branchless programming avoids:

    Again, there is no branching - the instruction pointer isn't manipulated, there's no branch prediction involved, no instruction cache to invalidate, no nothing.
This has nothing to do with whether the behaviour of some instruction depends on its arguments. Looking at the Microsoft compiler output from the article, the iadd (signed add) instruction will get different results depending on its arguments, and the movc (conditional move) will store different values depending on its arguments, but after each the instruction pointer will just move onto the next instruction, so there are no branches.

mymoomin commented on Numbers Are Leaves   christo.sh/numbers-are-le... · Posted by u/nodar-d
ludston · 8 months ago
Kurt Godel kind of threw this line of reasoning into the bin unfortunately. No system can be both complete and consistent, therefore the authors statement that the set theory he is studying is the basis of all mathematics as well as consistent is probably false.
mymoomin · 8 months ago
The article is right to say that set theory can serve as a foundation for almost all other mathematics, and you're also right to say that no reasonably-complex consistent system of axioms can be complete. The resolution to this is that if you ground something (let's say topology) in e.g. ZFC (the most commonly used system of axioms for set theory) then incompleteness in ZFC maps to incompleteness in topology. Here's an example https://en.wikipedia.org/wiki/Moore_space_(topology)#Normal_... .

There are other foundations, some of which are based on things other than set theory (category theory, type theory), but they're usually equivalent to ZFC ± a few axioms, because you can embed those other foundations in some kind of set theory, and embed set theory in the other foundations.

mymoomin commented on Fish 4.0: The Fish of Theseus   fishshell.com/blog/rustpo... · Posted by u/jdxcode
anonnon · 8 months ago
It's strange how the article starts off complaining about C++'s platform "issues":

> We’ve experienced some pain with C++. In short:

> tools and compiler/platform differences

before conceding that, because of Rust, they 1) are actually dropping support for a platform they previously supported and 2) can only support (in theory) a small fraction of those platforms supported by g++, but that that's OK because those are the only platforms which really matter. I get that it's a trade-off, but it would have been more intellectually honest to just admit this is one area (portability, backwards compatibility, and ABI stability) where C++ mops the floor with Rust, instead of pretending it's a another paintpoint Rust avoids.

mymoomin · 8 months ago
I don't see how the article is pretending anything. They had platform issues with C++ (portability and usability on the platforms they supported), and switching to Rust fixed those issues but gave them a different set of platform issues (they could no longer support Cygwin).

u/mymoomin

KarmaCake day37June 21, 2024View Original