HNHacker News
TopNewBestAskShowJobs

neerajsi

290 karma · joined October 9, 2017

submissionscomments
neerajsi··on Debugging a rustc segfault on Illumos
It makes me wonder though if illumos is worth it for a relatively small company to maintain. This bug came out of the larger ecosystem not knowing what to do for a niche OS.
neerajsi··on The Origins of DS_store (2006)
Putting in in the folder is also nice in that it naturally gets deleted when the folder is deleted
neerajsi··on The Origins of DS_store (2006)
I work on ReFS and a little bit on NTFS. Alternate data streams are simply seekable bags of bytes, just like the traditional main data file stream. Security descriptors, extended attributes, reparse points and other file metadata are represented as a more general concept called an "attribute".

You can't actually open a security descriptor attribute and modify select bytes of it to create an invalid security descriptor, as you would if it were a general purpose stream.

neerajsi··on A Git story: Not so fun this time
Microsoft's vfs for git is open source. So is scalar. These are the two main approaches used at Microsoft for large repos. Unfortunately the technically superior vfs approach was a nonstarter on macOS.
neerajsi··on Microsoft breached antitrust rules by bundling Teams and Office, EU says
I'd argue that Office has competition in the form of GSuite, which has collaborative features

So how much market share does Office have to lose to GSuite before Microsoft can implement features that their competitor has?

Put another way, does a dominant market player have to stagnate in order to avoid breaking antitrust law, rather than anticipating the needs of their customers to make their product more useful?

neerajsi··on Making Sense of Acquire-Release Semantics
I just wanted to clarify something about flushing caches: fences do not flush the caches in any way. Inside the CPU there is a data structure called the load store queue. It keeps track of pending loads and stores, of which there could be many. This is done so that the processor can run ahead and request things from the caches or to be populated into the caches without having to stop dead the moment it has to wait for any one access. The memory fencing influences how entries in the load store queue are allowed to provide values to the rest of the CPU execution units. On weak orderes processors like ARM, the load store queue is allowed to forward values to the execution pipelines as soon as they are available from the caches, except if a store and load are to the same address. X86 only allows values to go from loads to the pipeline in program order. It can start operations early, but if it detects that a store comes in for a load that's not the oldest it has to throw away the work done based on the speculated load.

Stores are a little special in that the CPU can declare a store as complete without actually writing data to the cache system. So the stores go into a store buffer while the target cache line is still being acquired. Loads have to check the store buffer. On x86 the store buffer releases values to the cache in order, and on ARM the store buffer drains in any order. However both CPU architectures allow loads to read values from the store buffer without them being in the cache and without the normal load queue ordering. They also allow loads to occur to different addresses before stora. So on x86 a store followed by a load can execute as the load first then the store.

Fences logically force the store buffer to flush and the load queue to resolve values from the cache. So everything before the fence is in the caching subsystem, where standard coherency ensures they're visible when requested. Then new operations start filling the load store queue, but they are known to be later than operations before the fence.

neerajsi··on Opening Windows in Linux with sockets, bare hands and 200 lines of C
Afaik, Windows RDP used to do more complex remoting of drawing primitives so that the host computer would send the clients instructions for drawing individual elements.

But for many years now, they switched to an approach of rendering all the graphics on the host side and then sending a video stream to the client using standard video compression. I think this compression based approach scales better for the common use cases, especially office apps where the display is mostly static. I guess the approach has almost gotten good enough that you can play games remotely that way.

neerajsi··on Deep Bug
Seems like it could be a compiler or GC bug (or a bug with the safe pointing interaction between compiler and GC).

It's possible that a write to the counts array is misdirected so it doesn't occur.

Is the sum of counts always less than the sum of vals?

On second thought, if counts is mmapped, GC might not be in play. But a similar bug might occur due to state being lost during an On-stack-replacement of one of the loops.

I'm not familiar with deep jvm stuff, but is there a way to ask the jvm for a compilation log to see if JIT OSR is happening?

neerajsi··on AMD funded a drop-in CUDA implementation built on ROCm: It's now open-source
I'm not in the gpu programming realm, so this observation might be inaccurate:

I think the case of cuda vs an open standard is different from os2 vs Windows because the customers of cuda are programmers with access to source code while the customers of os2 were end users trying to run apps written by others.

If your shrink-wrapped software didn't run on os2, you'd have no choice but to go buy Windows. Otoh if your ai model doesn't run on an AMD device and the issue is something minor, you can edit the shader code.

neerajsi··on How is a binary executable organized? Let's explore it (2014)
Wow, great read. I worked on the Windows DLL loader and we had to implement similar mechanics for similar reasons. The PE image format makes some part of this a little easier, but the complexity is essentially the same.
neerajsi··on Seventy versus One Hundred
Yeah, I also got 71.4 according to the same logic, but I can buy the argument in the follow on article that the amount of energy dissipated per unit time is what's constant.
neerajsi··on AST-grep(sg) is a CLI tool for code structural search, lint, and rewriting
Hi Herrington_d, Thanks for sharing this awesome tool! I'm trying to user it locally on some C++ code to match a method call: v = map->GetValueForKey(somethingUseless, key);

For some reason my simple query pattern 'GetValueForKey' isn't a match. Is there a way to get the 'sg' CLI to output the AST for some line of my target file so I can see what kind of pattern I need to write?

neerajsi··on I skipped to the ending
This is a really great point! The big tech companies are partly banks of human capital that can be deployed when an investment opportunity arises. Unlike money, the human capital actually cares about whether it's sitting idle or is efficiently deployed.
neerajsi··on Link-Time Optimisation (LTO)
Hi Ryan, nice to see you're doing well (I remember you from High School).

MSVC's LTCG (LTO) pipeline has been heavily in use at Microsoft for decades now. PGO and LTCG go together. LTCG is the default way most of our binaries are built.

A lot of work has been done to make MSVC LTCG fast and scalable. In particular, the compiler backend is multithreaded on a per-function basis, and there is also support for incremental LTCG that reuses previously compiled machine code and summary information.

neerajsi··on What every software developer must know about Unicode in 2023
I don't know this for a fact, but it's possible that the text run is logically considered to be Arial and the fallback could be handled as just a rendering step, rather than being encoded in the document. Doing it that way could allow the text to render on different versions of Arial, some of which do have a checkbox char, at the risk of the appearance and layout changing depending on which fonts are installed.
neerajsi··on Are You Sure You Want to Use MMAP in Your Database Management System? (2022)
I've been thinking for the past few years about how to get a scenario like 'git clone' of a large repo to go fast. One thought is to memory map the destination files being written by git and then copy/unzip the data there. You'd save a copy versus the staging buffer that you'd currently be passing to write(). However, the overhead of managing the tlb shootdowns would likely be fatal except for the largest output files.
neerajsi··on Full ignition for ESA’s reusable rocket engine
> Not sure who will spend days watching the same rocket takeoff and land :-).

Have you met a small child?

neerajsi··on eBPF Verification Is Untenable
I don't think jitting necessarily precludes counting runtime instructions. You could always jit in an internal variable that gets incremented for each high level instruction being translated. And of course you can optimize the increments within each basic block. There's even a cool minimum spanning tree algorithm due to Larus and Ball originally for path profiling that might be adaptable to reduce increments across the blocks.

I know this is a bit of an aside. The point still stands about the user not wanting their bpf program to terminate at runtime investment.

neerajsi··on The Rot Economy
It looks like the article could have been divided into two separate theses. The Adam Neumann problem is general unproductive investment of savings.

The Google/Meta problem is different: the challenge of investing in the context of an individual corporate identity and its configuration of human and intellectual capital. Amazon would be a nice contrast to the companies mentioned here. It's a good marriage of the more ephemeral and short term tech capital and traditional physical capital that can have bigger and more stable long term yields. Apparently it sucks to work in most orgs there :/.

neerajsi··on The legend of “x86 CPUs decode instructions into RISC form internally” (2020)
Renesas RX is the newest cisc I've seen.

https://www.renesas.com/us/en/products/microcontrollers-micr...

neerajsi··on The Rot Economy
Hot take: these are the kind of issues you'd expect if there is a significant amount of capital accumulation. There's always going to be dumb money doing things that make the news. How many failed railroads were made during the industrial revolution? How much money was squandered on tulip bulbs?

Intelligent investments take more time to culminate than unintelligent ones take to fail, so things would look pretty bad in any savings rich economy.

neerajsi··on From Stacks to Trees: A new aliasing model for Rust
I work with many people who are quite intelligent but early in their career or not domain experts in PL implementation. These people are perfectly respectable, but how long would it take to teach them how to map their source to the lifetime dependency tree with subtle rules in order to understand a borrow checker result that triggers an error? Without that understanding, a dev using rust would maybe try poking at their code unsystematically in hopes of getting it to work. I've seen this happen in other domains while people are ascending the learning curve.
neerajsi··on From Stacks to Trees: A new aliasing model for Rust
I think one measurable outcome here is what kind of error message you get when you do violate a rule and whether rust users know what to do to fix their code. As a person who loves to explore the complexity behind seemingly simple interfaces, this stuff is really cool. On the other hand, I don't relish having people break their brains to understand why similar code is accepted vs not.

I'm not a rust user myself, but I'm guessing from all the references to raw pointers that a lot of the code referenced here is actually not idiomatic for all but small snippets of high perf code, so maybe the complexity is not going to affect too many people.

neerajsi··on Mental Liquidity
This might be relevant: https://en.m.wikipedia.org/wiki/Self-authorship

According to the Kegan theory, it's possible. I'd be fascinated to see it if anyone knows of a study that demonstrates self authorship in a population of real people.

neerajsi··on Mental Liquidity
You're quite right. Science requires the skepticism to apply the stress to theories needed to make them strong. I'm assuming Einstein tried to raise objections using evidence to the contrary and alternative explanations.
neerajsi··on Mental Liquidity
Thanks for your point about death.

Death forces our species wide belief set to go through the constrained channel of education and communication, the same way that our bodily attributes go through the constrained channel of our germ-line genes.

This process lossily compresses the signals, which allows for drift or attenuation when the next generation reconstructs the beliefs and associated behaviors. Transmission also applies stress that acts as a filter to weed out beliefs that are no longer adaptive.

neerajsi··on The weird world of Windows file paths
Newest versions of Windows do let you use these names.
neerajsi··on Dropping the SAT requirement is a luxury belief
The point of homework is to help you learn the material. Okay, you didn't happen to need it. The point of _requiring_ the homework is so that the students who do need it actually do it and get something from the class. It has to be worth enough for they typicals to not total shirk it.
neerajsi··on Dropping the SAT requirement is a luxury belief
Can you elaborate on your statement?

I think it is more likely that culture drives genetics. If you have a group whose culture favors intermarriage, where marriage is encouraged and even arranged between families with intellectual success, and which enables the resulting couples to have many children, that would tend to drive the genetics of the group.

Sexual selection is tied to culture.

neerajsi··on Modernizing C arrays for greater memory safety: a case study in the Linux kernel
I think they were slightly off the mark. The bigger deal is avoiding an extra allocation for an entity that has a variable sized part.
← PreviousPage 3 of 5Next →