HNHacker News
TopNewBestAskShowJobs

SuchAnonMuchWow

598 karma · joined February 8, 2021

submissionscomments
SuchAnonMuchWow··on How to average floating point numbers (2015)
Kahan summation is better than naive summation, but not perfect. The stable_mean algorithm in the article is not perfect either. It just has more precision than the naive one, but it more or less has the same precision as twice-as-precise floats.

>>> data = (1_000_000.1, 1.1, -1_000_000.1, -1.1) * 25_000

>>> sum(data) / len(data) == -2.3283153183228934e-16

>>> sum(sorted(data)) / len(data) == 2.7122441679239272e-11

>>> stable_mean(data) == -2.571225228716577e-13

>>> float(sum(numpy.array(data, dtype=numpy.float128)) / len(data)) == 2.2648549702353195e-19

Note that in python there is a math.fsum function which return a perfectly rounded summation of floats. There are multiple different techniques for that, but they are more complex than Kahan summation.

>>> math.fsum(data) / len(data) == 0.0

SuchAnonMuchWow··on 2021.06.08 Certificate Lifetime Incident
You are supposed to be able to revoke the certificate you misissue.

LetsEncrypt automated the certificate creation, which resulted in very large number of certificate issued. But at the same time, it should be possible to revoke them all.

If the revocation mechanism doesn't scale as much as the creation, this is a huge problem.

This time, the misissued certificates probably won't cause large issues. But they are misissued nevertheless and should be revoked.

If they are not revoked because it would be too complex and will break WebPKI, then what will happen when a larger issue happen that require the revocation ?

SuchAnonMuchWow··on Apple, Mozilla, Google, Microsoft form group to standardize browser plug-ins
to be fair, the way plugins/addons are handled in a browser is a part where browser differs completely despite having the same engine
SuchAnonMuchWow··on Google can't pass its own page speed test
For once, I think this is a good initiative from google.

Most websites are over-bloated and this is a good incentive to move the web in the right direction.

SuchAnonMuchWow··on Is Euler’s Identity Beautiful? and If So, How?
e^(iτ) = 1, not 0
SuchAnonMuchWow··on Generating Coherent Noise Using Fourier Transforms
And for people like me, unfamiliar with it but still knowing what a Fourier transform is, just reading the algorithm I really see no reasons why it particularly "shouldn't work", as the author said.
SuchAnonMuchWow··on The NFT market bubble has popped?
You can just make the participants of a bet provide each a random number, and xor their results. If even one of them picked a real random number, the result will be random.

This is the basis of most distributed random number selection algorithm, which existed since a lot before blockchains.

In a smart contract, it could look like something like that:

1- each person which want to participate in the bet pick a random number, then send: their bet (0 or 1), the hash of the random number, and of course money to bet.

2- after some specified time, the first phase finish and no new person can bet. now everyone has to send their actual random number to the smart contract

3- after some specified time again, every random number gathered which had the correct hash are xored. If the popcount of the result is even, 0 win. otherwise 1 win. Everyone who send their random number and guessed correctly get a share of the total amount.

edit: note that I'm not overly familiar with smart contracts, so if this cannot work I would love to be explained why.

SuchAnonMuchWow··on The NFT market bubble has popped?
An actual casino without the need for a central authority can be implemented on smart contracts, and is the only real application of smart contracts that I see that is better than a centralized solution.
SuchAnonMuchWow··on Yuan Longping has died
> So why feel triggered?

Icons can be and are used by governments for propaganda, to improve the sentiment of nationalism, when great achievements of people is shown as achievement of the nation. This has been done by almost every governments, regardless of political leaning.

Reading others comments in the whole page, it appears that's what people see in that news, as they can't filter the propaganda from the achievements of a great man.

SuchAnonMuchWow··on 100 Largest Landowners in America
> 25. Jeff Bezos

> 49. Bill & Melinda Gates [NEW TO LR100]

I knew Bill Gates had a lot of land, but that information about Jeff Bezos is new to me. Too bad the report doesn't say how much land they own.

SuchAnonMuchWow··on [dead]
> Bitgrail meltdown of 2018

What happened ?

SuchAnonMuchWow··on Framework Laptop pre-orders are open, starting at $999
Thank you very much for what you build. It's amazing, and will be the perfect replacement for my aging laptop.

The only thing missing for me is an ethernet port (which I need to connect to the internal network at work). Do you have any plan to add it as an extension card ? If no, any technical reasons why not ?

SuchAnonMuchWow··on An intro to Zig's integer casting for C programmers
I agree, both choices are fine as long as they are consistent.

One issue with expanding all values to native word size is that this would manly benefit _very_ old hardware: modern CPUs are as fast directly manipulating any int size as they are manipulating "native word size", or even worse because vector instructions usually manipulate twice many int32 per cycle than they manipulate int64 (and twice many int16 as int32), even if not every code can be vectorized.

SuchAnonMuchWow··on An intro to Zig's integer casting for C programmers
C integer promotions are what remains of old computers systems which couldn't handle anything but a 'word'.

It result in things highly inconsistent on modern 64-bit machines:

For example, char/short are automatically promoted to int or unsigned int when an operation is performed on them, but this doesn't happen between int and long.

Simple things like adding two int16_t together to get a int16_t in return is really hard: you need a mask and a extra explicit cast, and you rely on the compiler being smart enough to understand what you are doing and to emit just the instruction you want.

But you don't need to do the same with int32_t, because reasons.

This is a bad default behavior, as it doesn't match either the intuition or underlying hardware, it is inconsistent across all integer types, and to understand why it works that way you need to understand how computers works 30 years ago.

D supporting C integer promotion might be a good thing for portability, but that's it.

SuchAnonMuchWow··on Elon Musk, master promoter
He is also _Techno-king_ at Tesla...

I have no ideas about the depth of his technical knowledge at both companies, but the titles themselves don't hold much value when he gave them himself.

SuchAnonMuchWow··on ARM vs. RISC-V Vector Extensions
I never actually wrote programs with risc-v vectors instructions, only for other ISA, so you seems to have much more experience than me on on that. Thanks for sharing your experience, and for the discussion.

> "multiple" doesn't imply "not fixed".

But in the case of risc-v, it really is "not fixed". For example, can you tell me the number of cycle it takes to execute this instruction: `vadd.vv v3, v1, v2` ?

Another example, in your implementation of memcpy:

``` 0: 86aa mv a3,a0

0000000000000002 <.L1^B1>:

   2: 00267757           vsetvli a4,a2,e8,m4,d1

   6: 12058007           vlb.v v0,(a1)

   a: 95ba                 add a1,a1,a4

   c: 8e19                 sub a2,a2,a4

   e: 02068027           vsb.v v0,(a3)

  12: 96ba                 add a3,a3,a4

  14: f67d                 bnez a2,2 <.L1^B1>

  16: 8082                 ret
```

From what I understand, you can't tell how long each vlb.v or vsb.v will take on a given processor, as it depend on the number of elements that will be returned in a4. The last iteration of the loop for example will probably take less time than the others, because the instructions will only have to load and store the trailing part of the data.

> If you look at the result of a vectorised memcpy() I did on the D1, you can see that the execution time is absolutely identical at 30.9 ns (31 clock cycles at 1.008 GHz) from sz=0 to sz=64

Again, I'm not arguing against the efficiency of RISC-V vector extension. I'm sure any processor designer will be able to implement it as efficiently as if the instructions were closer to the raw compute logic.

I'm not even arguing against the extension. If anything, I think I would prefer if an open CISC ISA was gaining popularity as an open source platform instead of RISC-V, because it would have the same portability implications, but with smaller code size and memory footprint, and while leaving a lot of room for innovation and optimization on the actual design.

What I actually argue against is calling it a RISC ISA, because while the core of the ISA is RISC, this vector extension is not.

SuchAnonMuchWow··on ARM vs. RISC-V Vector Extensions
The vector extension has many good properties, like the ability to adapt to various size/complexity of processors: it can be implemented slowly on a small processor, and quickly on fast processor. This is because the instructions are very abstract and most of the control is done by the core instead of the compiler, like splitting the vectors into chunks that can be computed per cycle by the core.

But then you loose the fixed instruction execution time: if you configure your registers to be larger than the compute units of the core, the instruction will take multiple cycles.

Citing wikipedia on RISC archs:

"The main distinguishing feature of RISC architecture is that the instruction set is optimized with a large number of registers and a highly regular instruction pipeline, allowing a low number of clock cycles per instruction (CPI)"

- a highly regular instruction pipeline: Nope

- a low number of clock cycles per instruction (CPI): Nope

In the 80'-90', it became apparent that RISC vs CISC was a moot point, and both types of ISA could be equally efficient. However, I think if you want a universal ISA, CISC is better because it is easier to decompose complex instructions into smaller ones on small processor, rather than to detect patterns of simple instructions and optimize them on a large processor.

This is the direction RISC-V took with the vector extension. But I find it a stretch to call it a RISC ISA then.

SuchAnonMuchWow··on ARM vs. RISC-V Vector Extensions
Also, the RISC-5 vector extension is at the opposite of the philosophy of RISC vs CISC
SuchAnonMuchWow··on Self-Reproducing Cellular Automata
your comment made me think of this comic: http://english.bouletcorp.com/2011/12/08/pixel-quantum/
SuchAnonMuchWow··on Evolution of Random Number Generators
Storing a number of the order of magnitude of n! will take the same amount of memory than storing a permutation of n elements, so what's the point ?
SuchAnonMuchWow··on What is Chia cryptocurrency and why is it bad news for hard drives?
But what you really want for smart contract is a language with integrated formal verification. The ability to formally prove some properties of your smart contract is much valuable than functional vs imperative paradigm.

Functional programming might makes it easier to detect flaws in your programs, but when there is billions at stakes and no recourse in case of a bug, you really want your program to be flawless.

SuchAnonMuchWow··on The compiler will optimize that away
No, the main gripe of this article is data locality, not vectorization. Those two are completely orthogonal and complementary: you can have data locality without vectorization and vectorization without data locality, and both bring performance improvements. But vectorization bring a constant speedup (from x2 to maybe x16 depending on the ISA of the processor), but data locality can improve performance much more because memory accesses are thousands of times slower than processor cycles.

But if the semantic of your programming languages doesn't allow your compiler to change the layout of your data in memory, then there is almost nothing the compiler can do to improve data locality in your application.

SuchAnonMuchWow··on Cars are about to be a software platform, subscriptions and all
Tangentially: does anybody knows good dumb all-electric cars ?
SuchAnonMuchWow··on Louis Rossmann: A Conversation with Steve Lehto on Right to Repair [video]
Also with Moore's law dying there is less and less need to upgrade the hardware, and the semiconductor industry will push more and more planned obsolescence.
SuchAnonMuchWow··on The Fourier transform is a neural network
the discrete Fourier transform, not the fast fourrier transform: the learned algorithm runs in O(n²) and not O(n*log n)
SuchAnonMuchWow··on The Fourier transform is a neural network
Here is an alternative idea around this:

Winograd transform can be seen as a depthwise convolution with fixed weights.

And similarly to DTF, winograd transform can be used to speed up convolutions: a 3x3 convolution can be implemented with a winograd transform + a 1x1 convolution + inverse winograd transform. This basically reduce the number of operations performed by 2.

Now, if a neural network is able to learn the weights of a depthwise convolution to match the coefficients of a winograd transform, that means you should be able to do this transformation when describing the architecture of your network. That way, you don't rely on your deep learning framework to do the transformation for you.

And more importantly you might end up with something more generic: perhaps the weights in the depthwise convolutions will not converge to the weights of a winograd transform, but to weight better suited to what you are trying to learn.

This is the same ideas which lead to the development of CNN: replace the fixed weights of convolutions used in traditional computer vision algorithm with weights that are learned by the network.

SuchAnonMuchWow··on Ideal divisors: when a division compiles down to just a multiplication
In this specific example, they do produce exactly the same result:

`a / b` is completely equivalent to `a * (1 / b)` when both b and 1/b are perfectly representable in floating point without rounding, which is the case for 2 and 0.5

SuchAnonMuchWow··on Amulet – a short poem with a lucky SHA-256 hash
an infinity of monkeys typing on 1000 keyboards do not write 1000 amulets. d64d835c41facc37b9c4a65546c9bb0bbbf8ba93ca9888849ad2f4d354896ac1
SuchAnonMuchWow··on Daniel Kaminsky, Internet Security Savior, Dies at 42
Note that it's not completely impossible: most journals have already written eulogy of a lot of famous and old people
SuchAnonMuchWow··on Apple sued for terminating account with $25k worth of apps and videos
Also, blockbuster rental terms were clearly defined. For example you knew for how long you had the movie.

In the case of apple you don't know, because apple might decide to terminate your account before you even had time to watch the movie.

← PreviousPage 5 of 6Next →