HNHacker News
TopNewBestAskShowJobs

sebastianmestre

151 karma · joined November 8, 2023

Quant Developer at GTS, teacher at UNR, former competitive programmer (3x IOI, 2x ICPC World Finals), competitive programming coach (1x IOI, 1x ICPC WF).

I like algorithms and abstraction

submissionscomments
sebastianmestre··on Valen's Memory Safety: A New Kind of Borrow Checking
IIRC this Verdagon guy had a language called Vale... is Valen a rename or a new project?

Edit: tfa makes it clear it's a separate project

sebastianmestre··on A few good ideas in programming languages
SSA = static single assignment?

I am confused

sebastianmestre··on Hilariously fast volume computation with the divergence theorem (2018)
From a computational standpoint, Pick's theorem seems more useful to find the number of interior points via

    I = 2 (A - B + 1)
Where area would be calculated using the sum of signed areas of triangles.
sebastianmestre··on Understanding the rationale behind a rule when trying to circumvent it
He used his blog to queue the work to be executed asynchronously by another MS worker that reads it
sebastianmestre··on Various LLM Smells
Is this really a split that exists?

In my case I see Claude produce code much worse than I would, but it's certainly much quicker and, even after reworking, it makes me finish tasks in less time.

sebastianmestre··on What's in a GGUF, besides the weights – and what's still missing?
If you want the token sequence, you ought to avoid discarding it when you produce the string output. This is because, even ignoring special tokens, different token sequences map to the same strings.

From a space perspective, this is actually better because tokenization tends to compress text quite well. For example, common tokens in English text take up ~4 characters on average (expands to 32 bits), but only take up a fraction of that to store (15-18 bits/token depending on vocabulary size)

In fact it appears that designing the tokens as a text compression encoding is a decent approach, since it's roughly what some LLMs do. For example, early GPT tokenizers followed byte pair encoding to create the vocabulary, which is a text compression algorithm from the 90s.

sebastianmestre··on A HN post with negative points – how?
This post you are commenting on (*6316) is a link post that points to the other one (*4663)

The normal behavior for link posts in HN is that the title takes you to the link address, not to the post address.

To enter the post address, you need to hit the "discuss"/"x comments" button.

So, what you describe is HN working as expected AFAICT, it's just a bit counterintuitive because it's an HN post linking to another, which is uncommon

sebastianmestre··on Using “underdrawings” for accurate text and numbers
I think 2.8 is where the Blender Foundation showed their commitment to improving the UX, but it just continually kept going from there
sebastianmestre··on Using “underdrawings” for accurate text and numbers
It's not perfect, but it's been vastly improved in recent years. If you lost interest in 3D art because of Blender's bad UX in the past, I recommend you give it another shot.

Also, there might be other new 3D software with better UX. I am not a Blender fanboy, but I do love 3D art and graphics programming and want as many people as possible to get into it :^)

sebastianmestre··on Are We Idiocracy Yet?
I don't think that's what the GP was going for... rather, implying that flat-eartherness is uncorrelated to IQ and, thus, the average IQ of flat-earthers is the same as that of the general population.
sebastianmestre··on The day I discovered type design
TFA is about letters, not programming in Haskell like I had assumed
sebastianmestre··on How to train your program verifier
> I would expect something more rigorous from verified code.

I think you just want the illusion of safety :p

A big advantage of verified code is that it enables you to write the sketchy and dangerous-looking code BECAUSE it's proven correct

In fact, skipping as many safety checks as possible is highly desirable. For performance, yes, but also because it's less code to maintain.

Our tools already do this to some extent, for performance. E.g. compilers that remove your bounds or type checks in the generated code when it can prove it's not needed.

sebastianmestre··on It's all a blur
yep, some padding fixes this

JPEG compression can only move information at most 16px away, because it works on 8x8 pixel blocks, on a 2x down-sampled version of the chroma channels of the image (at least the most common form of it does)

sebastianmestre··on I miss thinking hard
When you're a beginner you're a beginner, no way around it.

But understanding your weaknesses and working on them is huge, and I think most people just don't try to do it.

Being stuck for days is something to be overcome.

The next step would be being slow because you are trying out many different ideas and have no intuition for what the right one is.

sebastianmestre··on I miss thinking hard
I did competitive programming seriously between '17 and '24, then kept on coaching people

As a beginner I often thought about a problem for days before finding a solution, but this happened less and less as I improved

I got better at exploiting the things I knew, to the point where I could be pretty confident that if I couldn't solve a problem in a few hours it was because I was missing some important piece of theory

I think spending days "sitting with" a problem just points at your own weakness in solving some class of problems.

If you are making no articulable progress whatsoever, there is a pathology in your process.

Even when working on my thesis, where I would often "get stuck" because the problem was far beyond what I could solve in one sitting, I was still making progress in some direction every time.

sebastianmestre··on The Anti-Pomodoro Technique: Focus on Taking Breaks, Not Watching the Timer
I used to love Pomodoro until I found out that it goes against my own interests.

I was a teenager with focus issues when a teacher introduced me to Pomodoro. It was great because I was finally able to get my schoolwork done (I would regularly fail 3-4 classes every year before this). The general structure he gave was as follows:

- You split time into work/rest intervals

- At the start of each work interval, you set a 15-minute timer and plan out what you are going to do in the interval

- When the timer goes off you HAVE to stop

- Then you set a 5-minute timer and rest until it goes off

- Repeat until you are done

Back then, the "planning every interval" part was hard for me but just forcing me to rest was enough to do what I needed to do. In reality, 90 minutes of homework wasn't enough to make me tired (I would go on 10-hour long programming sessions with no breaks on the regular), just emotionally tired, bored, or frustrated. The breaks solved that.

I think the timings he suggested are adjusted for younger people (15 work minutes instead of the more common 25, and no long break after N cycles). As I grew up, I slowly lengthened the work and rest periods up to 25min work and 7min rest.

The benefits of Pomodoro are Three-fold as far as I can tell:

- You plan out your work, so you spend a higher % of work time doing stuff that matters.

- You rest regularly, so you are able to keep working for longer.

- You limit rest time, so you spend a higher % of time working.

Recently, after I mentioned I use Pomodoro, one of my mentors made the observation that the interest of a paid worker is not to work as long as possible during your work hours. Instead, it's to get your work done as easily and effectively as possible, get paid (hopefully make your boss and coworkers happy, get a raise and promotion every once in a while), and get out.

Doing the math, with my flavor of Pomodoro (25/7, no long breaks) you end up working 5:30-hours out of an 8-hour workday (it's roughly 5:10 with the technique taken straight from Wikipedia). I wonder if he meant that it's possible to be very effective while working significantly less than 5 hours a day. I wonder how much I could get done in just 2 or 3 hours of fully focused work, and how I would feel about it at the end of the day.

sebastianmestre··on What came first: the CNAME or the A record?
I kind of wish they start sending records in randomized order to take out all the broken implementations that depend on such a fragile property
sebastianmestre··on Fil-Qt: A Qt Base build with Fil-C experience
I agree that your previous comment could be shorter, maybe half as long, with some effort. For example, this sentence could just be removed without changing the content or tone:

> But I think this is an interesting perspective difference to discuss and not a blatant ad hom argument used to ‘fight’ Rust users on the internet.

(It is already clear that you share your perspective because you think that it's interesting and not a fallacy.)

Then, there are some paragraphs close to the end that seem to repeat ideas.

But IMHO it's a good, nuanced comment that both addresses shortcomings in current discourse and adds ideas to the discussion. This is obviously difficult to do in few words.

A few concepts that come to mind from your comment, but I missed from others:

- Are Rust-style ownership semantics complex or just hard for me? Is it an issue of familiarity only? Is it ergonomics?

- Are they hard in general or just due to the way I like to program? How can I change my style to better fit the model?

- Are they even fit for the software I write? i.e. is it worth it to change how I program to better fit the model?

- What other tools are there to deal with resources?

- What could a programming language do to offer multiple of those? How can we mix GC, region types, linear/uniqueness types, manual management, etc. in a single language?

- A bunch of stuff about discourse in this thread and HN/the internet in general (which is maybe not the point of the comment and could be omitted?)

sebastianmestre··on Two Concepts of Intelligence
This is kind of bait-and-switch, no?

The author defines American style intelligence as "the ability to adapt to new situations, and learn from experience".

Then argues that the current type of machine-learning driven AI is American style-intelligent because it is inductive, which is not what was supposedly (?) being argued for.

Of course current AI/ML models cannot adapt to new situations and learn from experience, outside the scope of its context window, without a retraining or fine-tuning step.

sebastianmestre··on Accounting for Computer Scientists (2011)
Fwiw, I think the four in the wikipedia comes from two people using the double entry system simultaneously.

So it's two records in the landlord's own books which u dont necesarily know about, and two records in your books.

sebastianmestre··on 2D Signed Distance Functions
To add some more detail, the max of two SDFs is a correct SDF of the intersection of the two volumes represented by the two SDFs, but only on the inside and at the boundary. On the outside it's actually a lower bound.

This is good enough for rendering via sphere tracing, where you want the sphere radius to never intersect the geometry, and converge to zero at the boundary.

A particular class of fields that have this property is fields with gradient not greater than one.

For example, linear blends of SDFs. So given SDFs f and g you can actually do (f(pos)+g(pos))/2 and get something you can render out the other side. Not sure what it will look like, or if it has some geometrical interpretation though.

Note that speed of convergence suffers if you do too many shenanigans.

sebastianmestre··on 2D Signed Distance Functions
You can take the minimum of two SDFs, which more or less gives you an SDF for their union. The maximum is the intersection. A few years ago I wrote a DSL that writes the SDFs for you, for my university programming languages course. https://github.com/SebastianMestre/school/tree/master/univer...
sebastianmestre··on Classical statues were not painted horribly
I think the pictures of the reconstructions are source enough, they look horrible
sebastianmestre··on I fed 24 years of my blog posts to a Markov model
Pretty sure that OpenAI uses BPE in their GPT models
sebastianmestre··on I fed 24 years of my blog posts to a Markov model
I had the same feeling while testing the code. It might be caused by seeing the increasingly coherent output of the different models, makes you feel like it's getting smarter.
sebastianmestre··on I fed 24 years of my blog posts to a Markov model
Cool article, it got me to play around with Markov models, too! I first did a Markov model over plain characters.

> Itheve whe oiv v f vidleared ods alat akn atr. s m w bl po ar 20

Using pairs of consecutive characters (order-2 Markov model) helps, but not much:

> I hateregratics.pyth fwd-i-sed wor is wors.py < smach. I worgene arkov ment by compt the fecompultiny of 5, ithe dons

Triplets (order 3) are a bit better:

> I Fed tooks of the say, I just train. All can beconsist answer efferessiblementate

> how examples, on 13 Debian is the more M-x: Execute testeration

LLMs usually do some sort of tokenization step prior to learning parameters. So I decided to try out order-1 Markov models over text tokenized with byte pair encoding (BPE).

Trained on TFA I got this:

> I Fed by the used few 200,000 words. All comments were executabove. This value large portive comment then onstring takended to enciece of base for the see marked fewer words in the...

Then I bumped up the order to 2

> I Fed 24 Years of My Blog Posts to a Markov Model

> By Susam Pal on 13 Dec 2025

>

> Yesterday I shared a little program calle...

It just reproduced the entire article verbatim. This makes sense as BPE removes any pair of repeated tokens, making order-2 Markov transitions fully deterministic.

I've heard that in NLP applications, it's very common to run BPE only up to a certain number of different tokens, so I tried that out next.

Before limiting, BPE was generating 894 tokens. Even adding a slight limit (800) stops it from being deterministic.

> I Fed 24 years of My Blog Postly coherent. We need to be careful about not increasing the order too much. In fact, if we increase the order of the model to 5, the generated text becomes very dry and factual

It's hard to judge how coherent the text is vs the author's trigram approach because the text I'm using to initialize my model has incoherent phrases in it anyways.

Anyways, Markov models are a lot of fun!

sebastianmestre··on Spectral rendering, part 2: Real-time rendering
> very cyan but not very green and blue (no realistic example here)

Very high temperature blackbody radiation perhaps?

sebastianmestre··on At the end you use `git bisect`

    git rebase --onto squashed nonsquashed next-pr
Works fine in my experience (except when submodules are involved)
sebastianmestre··on Language models are injective and hence invertible
No, yeah, totally. Even assuming binary vectors 2^768 is a ridiculously huge number. The probability of collision even assuming a bad sampling that discards 75% of dimensions is still vanishingly small.
sebastianmestre··on Language models are injective and hence invertible
I think that the latent space that GPT-2 uses has 768 dimensions (i.e. embedding vectors have that many components).
Page 1 of 2Next →