bharathg

13.6K posts

bharathg

bharathg

@BharathQuant

Systematic Quant trading/C++/Stats. Algos that trade Futures/currencies/Stocks. All tweets are entertainment only not financial advice.

Dallas, TX Beigetreten Ağustos 2013
3.8K Folgt1.2K Follower
bharathg retweetet
Howie Hua
Howie Hua@howie_hua·
When I was in high school, I didn't realize difference of two squares literally meant "What's the difference between these two squares?" Here's how we can visually show why x²-y²=(x-y)(x+y).
English
109
1K
7.8K
346K
bharathg
bharathg@BharathQuant·
@systematicls There is one rule that can save you. Just one rule. Don’t work with a recruiter who has not been in that same niche area for less than 10 years. That is all. Rest will sort out.
English
0
0
4
709
sysls
sysls@systematicls·
If you are a junior in quant, you must be bedazzled by the large number of recruiters trying to get into your pants. PSA: 99.95% of recruiters suck absolute ass. They are basically resume shovers that will push your resume onto a company's ATS with their big fat name as a referral in hopes that you somehow, miraculously, make it through the pipeline. Many of these people are volume farmers with no alpha. IF you give them permission to "apply" for a job, you might as well incinerate your resume and self-apply for a ban at the firm of choice, because that is going to be the modal outcome. Instead, you want to look for the 0.05% of recruiters that ACTUALLY have an in with the hiring manager, the decision maker, the big DAWG. Here's how you can tell. Recruiter: "Hi {you}, here are some good opportunities with {firm}." You: "Are you in direct contact with the hiring manager? is the relationship warm? Can you reach him via phone or email." Recruiter: "Ah, erm, uhm, my direc..." You: "Sorry, I only work with people who have a direct, warm contact with the hiring manager. Can you put me in touch with {this person at the firm}?" Often times, you will find this "person" does not exist - because these bottom feeder recruiter firms do not in fact, have a warm touch with the hiring manager. --- You may think this crass, but the point here is simple. If they do not have an open, WARM line of communication with the hiring manager, YOU ARE BETTER OFF DROPPING THE RESUME WITH A WARM TOUCH TO THE FIRM HR ON LINKEDIN. Have a good day, and happy job hunting!
English
10
10
364
42.6K
bharathg retweetet
Debasish (দেবাশিস্) Ghosh 🇮🇳
yet another example of why I like types .. "capability types" for iteration in Rust .. a simple Rust function, but I love the information density that the type gives .. It says: I don’t care what the underlying source is (string chars, slice, deque, range over a collection, etc.). I only need the capability “can pull from both ends”. What’s special in Rust is the combination of: • expressing “two-ended traversal is available” as a static, checkable capability (DoubleEndedIterator), e.g. is_palindrome(std::io::stdin().lines()) simply won’t compile because `lines` can’t go backwards. That’s not a runtime surprise, it’s a type error. • keeping it zero-cost (no virtual dispatch unless you opt in) and • having it compose through all the out-of-the-box iterator adapters so you can build pipelines and still keep that capability. So it’s not just “without allocation”, and not just the trait - it’s how those properties statically compose. Note: C++20 bidirectional_range offers similar capabilities. But comparing ergonomics + safety in generic code, Rust often wins because the ownership/borrowing model prevents invalidation and aliasing bugs.
Debasish (দেবাশিস্) Ghosh 🇮🇳 tweet media
English
5
8
73
6.2K
bharathg retweetet
Vivek Galatage
Vivek Galatage@vivekgalatage·
Code reviews catch issues early - naming, structure, ownership semantics. Ben Deane's CppCon talk shares what he learned from years of doing them. youtu.be/dLsZ3t_kG1U
YouTube video
YouTube
Vivek Galatage tweet media
English
2
12
92
5.2K
bharathg retweetet
Fernando
Fernando@Franc0Fernand0·
If you think knowing about data structures and algorithms is not important in software development, consider what is used in the Linux kernel: 1. Linked list and doubly linked list 2. B+ Trees 3. Interval trees 4. Red-Black trees used for scheduling, virtual memory management, and more 5. Priority sorted lists used for mutexes, drivers, 6. Radix trees, used for memory management and networking-related functionality. 7. Hash functions 8. Priority heap, used in the control group system 9. Bit arrays, used for dealing with flags, interrupts 10. Binary search, used for interrupt handling, register cache lookup 11. Hash tables, used to implement inodes, file system integrity checks 12. Depth first search, used in directory configuration 13. Breadth first search, used to check correctness of locking at runtime 14. Knuth-Morris-Pratt string matching 15. Merge sort on linked lists, used for garbage collection, file system management 16. Boyer-Moore pattern matching 17. Semaphores and spin locks.
English
17
56
569
33.3K
bharathg
bharathg@BharathQuant·
You can also do locally linear, PLS and some variations of Ridge based on priors. But yes simple models are the best and are being used on the model building side by pretty much all the multi billion stat arb shops. The signal itself could be anything plug and play but the actual predictive model is usually regression in some form.
English
0
0
1
33
bharathg
bharathg@BharathQuant·
@itsmartingale Timer threads evicting cache, interrupts not steered properly, etc.
English
1
0
0
1.5K
Martin Gale (λ,π)
Martin Gale (λ,π)@itsmartingale·
HFT developer interview question. What do you think this represents? Is there anything wrong with this latency distribution?
Martin Gale (λ,π) tweet media
English
23
2
184
33.8K
bharathg
bharathg@BharathQuant·
@Adriksh I meant “x” not “c”
English
0
0
1
16
bharathg
bharathg@BharathQuant·
@Adriksh 10 12 . Since c is a parameter this happens even post c++17 . NRVO does not work for parameters of function . If this were an automatic object NRVO would have kicked in. If you don’t want the 2 copies pass it in by reference
English
2
0
2
181
Adriksh
Adriksh@Adriksh·
A C++ puzzle. What does this print?
Adriksh tweet media
English
34
8
158
25K
bharathg retweetet
Debasish (দেবাশিস্) Ghosh 🇮🇳
and now for some readings of user level RCU .. and a landmark paper that led to the implementation of liburcu - the user space RCU library, a Christmas Day evening read .. Why RCU is difficult in user space ? RCU, particularly its high-performance Quiescent-State-Based Reclamation (QSBR) variant, is easier in kernel mode because the kernel scheduler automatically detects quiescent states whenever a CPU context-switches, enters user mode, or idles, allowing grace-period tracking without any explicit cooperation from kernel code. In user mode, applications lack this built-in mechanism, so threads must explicitly register and periodically report quiescent states (e.g., by calling specific functions), imposing invasive global constraints on the entire application. These requirements make user-level RCU harder to adopt broadly, as they complicate library design and require modifications to all potentially reading threads, which is impractical in many user-space programs. User level implementations of RCU : This paper contributes to user-level RCU by formally describing efficient and flexible implementations that overcome the limitations of prior approaches, which either imposed high read-side overhead or severely restricted application design. It presents multiple classes of RCU (including QSBR, memory-barrier, signal-based, and bullet-proof variants) with detailed algorithms, performance analysis, and comparisons to locking, directly forming the foundational basis for the liburcu library's core flavors and enabling its widespread adoption in user-space applications.
Debasish (দেবাশিস্) Ghosh 🇮🇳 tweet media
English
1
7
32
2.1K
bharathg
bharathg@BharathQuant·
@lauriewired 42 99. Assigning to return value by reference. But argument was passed in by reference to begin with.
English
0
0
1
1.2K
LaurieWired
LaurieWired@lauriewired·
little C++ puzzle I made, what prints?
LaurieWired tweet media
English
204
57
1.6K
190.6K
bharathg retweetet
HinduJagrutiOrg
HinduJagrutiOrg@HinduJagrutiOrg·
A #Hindu was lynched and burned alive in Bangladesh. If this had happened anywhere else, the world would have screamed. Why not now? Stop Hindu Persecution #Protect_Bangladeshi_Hindus
HinduJagrutiOrg tweet media
English
6
199
266
8.7K
bharathg retweetet
David Gu
David Gu@davidgu·
By default, the most popular Rust crate for Postgresql (tokio_postgres) waits for *2 hours!!* before timing out a dead connection. All because of a bad decision from 1989 🧵👇️
David Gu tweet media
English
14
22
328
34.8K
bharathg
bharathg@BharathQuant·
@debasishg This was a good article. Yes Cache line alignment for head and tail is necessary to avoid false sharing . In addition Epoch based GC could also help avoid further avoid expensive instructions cl.cam.ac.uk/techreports/UC…
English
0
0
1
12
bharathg retweetet
Debasish (দেবাশিস্) Ghosh 🇮🇳
One of the cool tricks I like about ring buffer implementation is avoiding false sharing via padding / alignment .. In concurrent rings (especially SPSC), head and tail are frequently updated - possibly by different threads. If they share a cache line, you get false sharing: each thread’s updates invalidate the other’s cache line even though they’re touching different fields. Typical fix: • Put head and tail on different cache lines using padding/alignment, e.g. #[repr(align(64))] in Rust or explicit padding fields. • Or store them in separate structs each cache-line-aligned. This reduces cache-line ping-pong and stabilizes throughput/latency.
David Gu@davidgu

We forked Chromium and bolted on a lock-free, zero-copy, low-latency shared memory ringbuffer written in Rust We needed to IPC 100+ MB/s of raw video, and Chromium's WebSocket implementation is dreadfully inefficient

English
7
15
237
19.9K
bharathg
bharathg@BharathQuant·
I think one important fact missed by all these naïve "If you have alpha why publish" people is, one could have several pieces of the puzzle and they could be missing a very important component and reading carefully curated material could inspire them to complete this missing piece of the puzzle.
English
1
0
2
117
sysls
sysls@systematicls·
One additional argument that is often made by people strictly in the "there is no value for paid writings" camp is that as long as a primary source has existed before - either in the form of papers and/or a collection of writings somewhere, that paid writings must therefore not be worth much. I think that is very clearly a fallacy, because it is trivial to reason about that push / pull mechanisms for content are not "worth the same" - EVEN IF (for the sake of argument) that the information presented is entirely derivative (i.e. without additional insight). There are many jobs (even/especially within our industry) and entire industries, whose very large portion for being is the search, retrieval and *intelligent summary* of information that is: 1) Relevant to the topic 2) Easy to digest 3) Factually correct Information that exists in cold storage has a very low value (e.g. when was the last time you paid Wikipedia) BECAUSE: 1) There is a large activation cost to discover it 2) There is a large activation cost to consume it On the other hand, we (humans), are collectively more than happy to pay for goods and services that push relevant, correct information that is easy to digest because the costs of search and consumption are paid for. E.g. Data feeds? Subscription feeds? Research feeds? We can then severely reduce the latent energy required to overcome searching and focus on ideation / implementation. --- All I'm saying is that humans have and probably will always require forms of filtration and abstraction. Our context windows are extremely small. I have personally found that paying for useful content, even if I know somewhat that 80-90% of the content is an intelligent search and filtration, IS paying for a form of abstraction that makes my life easier. Recently I have been extremely interested in high performing computing tricks, tips and studies. Intellectually, I know that there exists (probably) hundreds of thousands of pages of information about computers. Within these hundreds of thousands of pages, I will likely find hundreds of pages that are relevant to me, and specifically, I will probably have to consume all hundreds of them to distill the information and facts I am looking for from first principles. I could probably spend a couple of months doing that and learning HPC from first principles. Or, I could simply pay for the abstraction in a field that is orthogonal to my area of comfort.
sysls@systematicls

x.com/i/article/2000…

English
1
2
14
5.9K