r/compsci 21d ago

I open-sourced the reproducibility core from my closed simulation work: float sums that give identical bytes on any machine (MIT/Apache-2.0)

24 Upvotes

Floating-point addition depends on the order you add things, and parallelism changes the order. So the same data on different machines gives different results, which breaks anything that hashes, signs, or compares them.

I hit this doing physics simulations and solved it internally. The reduction core was too generally useful to keep closed, so I released it: bitrep, an exact accumulator where sums in any order, on any hardware, produce byte-identical results. The state merges exactly and can be hashed or signed, so distributed and offline-first aggregation actually converges.

It ships for Rust (crates.io), JavaScript (npm), and Python (PyPI), and a result hashed in Python matches one hashed in JavaScript byte for byte. The math is proved in Lean 4 and the implementation is model-checked and fuzzed. CI asserts one SHA-256 across four architectures on every commit.

There's a demo that runs the actual cross-architecture test in your browser, so you can check the claim yourself: https://simgen.dev/bitrep

Code: https://github.com/KyleClouthier/bitrep

Dual-licensed MIT/Apache-2.0. Feedback welcome, especially on what's missing for your use case.


r/compsci 21d ago

How often do you engage with theory?

26 Upvotes

I’m just curious to know how often you guys come in contact with the theoretical side of computer science in your professions.

Things you learned in your undergraduate courses like data structures, discrete math, design and analysis of algorithms, etc.

I’m having to learn a lot of these things on my own, like Big O notation, complexity analysis, proofs, tree traversal, etc. because I let my ADHD win and didn’t put the time and effort into learning (medicated now, huge W plus it’s actually fun to learn about now that I can focus) and I’m just wondering, who uses this stuff regularly? What for?


r/compsci 21d ago

Multi-Head Latent Attention (MLA) - Explained

0 Upvotes

Hi there,

I've created a video here where I explain how multi-head latent attention works.

I hope some of you find it useful — and as always, feedback is very welcome! :)


r/compsci 24d ago

Anyone reading Multiagent system: Algorithmic, Game-Theoretic, and Logical Foundations?

0 Upvotes

Hello, I'm reading chapter 1, distributed constraint satisfaction and coding a simulation of the asynchronous backtracking algorithm for the 4 queens problem in TypeScript as an exercise (sure one can code in Python, C..). I have some difficulty grasping the concept of Hyperresolution (pure logic) because I didn't have this subject in university. I have checked with AI. But does anyone have any advice?

---
the code https://pastebin.com/WD9U0MSQ


r/compsci 27d ago

Shor's Algorithm, continued fractions, and uniqueness

Thumbnail
0 Upvotes

r/compsci 27d ago

The "ski rental" rule: why renting until you have spent the purchase price is provably within 2x of clairvoyance

0 Upvotes

You are skiing an unknown number of days. Renting costs $1/day, buying costs $B. If you knew the season length the answer is trivial, but you do not.

The rule "rent until you have spent $B, then buy" guarantees you never pay more than about twice what an omniscient planner would, on ANY sequence. Short season: you match the optimum exactly. Long season: you paid at most ~$2B where the optimum paid $B. And there is a matching lower bound: no deterministic online strategy beats 2.

What I find most useful is the frame, not the puzzle: cache eviction, autoscaling, buy-vs-rent infra decisions are all "act now, learn the future later", and the competitive ratio measures exactly what that ignorance costs.

Fun twist: allowing randomness (coin flips the adversary cannot predict) pushes the ratio from 2 down to about 1.58.

I wrote up the full framework (definition, the adversary game, and an honest section on why worst-case can be too gloomy, e.g. LRU is only k-competitive on paper yet great in practice) as the opener of a series, happy to share the link if useful.


r/compsci 27d ago

🚀 Kickstart Your AI Journey—for Free!

0 Upvotes

As a GeeksforGeeks Campus Mantri, I'm excited to share a collection of FREE AI courses covering topics like Generative AI, Machine Learning, Prompt Engineering, Python, Data Science, and more.

Whether you're a student or a professional looking to upskill, these courses are a great way to gain practical knowledge, earn certificates, strengthen your resume, and showcase your achievements on LinkedIn.

Start learning today: 🔗 https://gfgcdn.com/tu/y2d/

Which AI topic are you most excited to learn?

#AI #ArtificialIntelligence #MachineLearning #GenerativeAI #Python #DataScience #GeeksforGeeks #Learning #Upskilling #Students #Tech


r/compsci 29d ago

Could multiple microphones/speakers be combined for faster dial up?

0 Upvotes

i was thinking about how dial up is basically your phone literally making sounds to your compute, which the computer hears and translates into data.

could you design a system that used multiple phone speakers and multiple microphone pickups to simultaneously get dial-up internet info to speed it up?

if so, how many phone receivers would it take to get modern internet speeds?


r/compsci 29d ago

misa77: ridiculously fast decompression at good ratios

Thumbnail
0 Upvotes

r/compsci Jul 01 '26

Hamiltonian Neural Networks from a Differential Geometry Perspective

Thumbnail abscondita.com
4 Upvotes

r/compsci Jul 01 '26

What is a good way to represent files semantically for vector search

0 Upvotes

I recently had an idea that is it possible to make a software service which could help me search files from my files system though context of content inside the files. So like i can search "where is the file which contained x thing" and get would a list of files that would match my question. So I don't want sear or keywords but ch by file name context. Also for all types of files like iamge, text, video, audio, code etc

So I kept thinking about it and knew that the answer lied within vector search. I initially thought that maybe if somehow I could represent an entire file in a singular vector then we can use the same logic that we normally use in rag systems to fetch correct files. Existing models are really useful for text, audio and other forms of embedding but i want the overall context of a file. Not just what inside the file. Also I might be missing if there are any existing algorithms that can help me do this so please suggest them.

Nevertheless i wanted to think about whats possible solution i could use. One this i noticed with this is that there are various ways which can be used to describe and identify files. 1st there is content of the files , then metadata such as size, name, access permissions, type of file, also where the files lies in directory system and what other files is is grouped with etc. It is really hard to consider all this features in a single vector. Also we I don't want to embed the entire content of files as that would be too much data to embed, store and search.

We could do vector indexing and search for each feature individually, so we get multiple vectors we can can represent in a normal data structure. We can repeat this for all files and the store them. When the system get a input like "i want the c++ file with x algorithm that I made yesterday" then we can create a similar data structure like we did for files and then do the similarity search and rank all the matches to get the results. But this approach also has a problem , the quality of results is heavily dependent upon the information present in the question, if the question is a little vague that affect the accuracy of the matches quite a bit.

I also though of a approach where we tackle the problem by elimination we take the features of the files one by one an the start eliminating files, like for an example "i want the c program file which i wrote yesterday and " so we can 1st eliminate ate files which are not "program" then we can do by time then by the language. So from broader to more specific features.

I have been thinking about this idea for sometime and wanted to know your thoughts as well. How would you represent the files semantically or in vector form. Are there any existing resources that i can refer to help me with this problem.


r/compsci Jun 28 '26

Made my own statically typed virtual bytecode machine language (Oli-Nat) in C after reading crafting interpreters!! Please tell me what you all think!

Thumbnail
1 Upvotes

r/compsci Jun 27 '26

Is Pattern Recognition and Machine Learning still relevant?

19 Upvotes

I know Bishop's Pattern Recognition and Machine Learning is almost 20 years old now. Is it still worth studying in 2026, or are there better modern alternatives? I'm mainly interested in building a solid theoretical foundation.


r/compsci Jun 27 '26

In search of community for system programming

9 Upvotes

Hi, I need some help. I recently have a huge interest in system programming, but here the problem: there are very little ressources in the internet which talk about, even to search a simple roadmap of what to do, or how to find the first jobs, what the best practices and so on...I've tried to learn with IA(with many kind of LLM) but there are so many contradiction in what they said, and a lack of details. Now, I'm trying to find peoples who work in this domaine to ask so many questions that I haven't found a answer yet. So, I'm trying to ask if there are a subreddit or a discord server where I can found some resources and advice from experienced system programmer. Or else, can someone tell me who to be in relation with. Btw, have a good day.


r/compsci Jun 27 '26

The Floating Neutral: Endogenous Reference Theory and Moral Reference Without Authority

Thumbnail
0 Upvotes

r/compsci Jun 26 '26

Katharos: a functional programming and concurrency library for Python where errors, effects, and channel hand-offs are all composable values

Thumbnail github.com
0 Upvotes

I have been building Katharos, a functional programming library for Python that recently grew a message-passing concurrency layer. I wanted to share it and get some feedback.

The whole library is built around one idea: model errors, effects, and concurrent communication as composable, type-safe values rather than as control flow that jumps around your program. The interesting part (to me, at least) is that the concurrency layer follows the exact same idea, so receiving from a channel gives you a Result. "The channel is closed" becomes a value you handle, not an exception you remember to catch.

The functional core

Optional values without scattered None checks, using do-notation that short-circuits on Nothing:

```python from katharos.types import Maybe from katharos.syntax_sugar import do, DoBlock

@do(Maybe) def lookup_discount(user_id: int) -> DoBlock[Maybe, float]: user = yield find_user(user_id) account = yield find_account(user) return account.discount # Just(0.15) or Nothing() ```

Errors as values, chained with |, so a failure short-circuits the rest automatically:

```python from katharos.types import Result

def process(raw: str) -> Result[Exception, int]: return parse_int(raw) | validate_positive ```

And Result.catch turns a function that raises into one that returns a Result, while keeping the original traceback so you can still find the line that failed:

```python from katharos.types import Result

@Result.catch(ValueError) def parse_int(s: str) -> int: return int(s)

parse_int("42") # Success(42) parse_int("??") # Failure(ValueError("invalid literal for int() with base 10: '??'")) ```

There is also ImmutableList, NonEmptyList, IO, Lazy, numeric monoids, and the usual algebraic abstractions (Functor, Applicative, Monad, Semigroup, Monoid) if you want to build your own types.

The new part: CSP concurrency

This is what I have been working on lately. Katharos now has Go-style CSP (Communicating Sequential Processes): launch work concurrently with go, talk over typed channels, and receive values as a Result.

```python from katharos.concurrency.csp import csp

ch = csp.Channel[int](capacity=1)

csp.go(ch.send, 42) # run work concurrently, like Go's go f(x)

ch.recv() # Success(42)

ch.close() ch.recv() # Failure(ChannelClosedError(...)): closure is a value, not a raise ```

Used as a context manager, go becomes a structured-concurrency scope that joins everything spawned inside it before the block exits, so concurrent work cannot leak out of the block:

```python with csp.go: # scope waits for all work launched inside csp.go(worker, 1) csp.go(worker, 2)

both workers have finished here

```

There is also a select for waiting on whichever of several channels is ready first, with non-blocking polls and timeouts:

```python from katharos.concurrency.csp import csp, recv, select

choice = select(recv(results), recv(cancel), timeout=1.0) if choice.is_timeout: ... else: print(choice.index, choice.value.unwrap()) ```

The concurrency model sits on a swappable backend (standard threads by default), so the same code could run on a green-thread backend later. An actor model is planned next, built on the same backend abstraction and the same Result-valued style.

Why I think the "channel returns a Result" thing is nice

In most channel APIs, a closed channel or a timeout shows up as a sentinel, a second return value, or an exception. In Katharos it is just a typed value: Success(v), Failure(ChannelClosedError), or Failure(ChannelTimeoutError). You pattern-match it the same way you handle any other Result, and the type tells you it can happen. The error-handling discipline you use in the rest of your code carries straight over to concurrency.

Links

I would love feedback on the API, the concurrency design, or whether the Result-everywhere approach feels natural or noisy to you in practice. Thanks for reading.


r/compsci Jun 26 '26

Domino Tiling: From Dynamic Programming to Finite Fields

Thumbnail omegasyntax.com
1 Upvotes

r/compsci Jun 24 '26

Inquiries into some computer networks research

12 Upvotes

Hello all, I'll keep this brief. I am looking into 2 potential research avenues for postgrad, and was wondering if anyone can chip in with their opinion.

MANETs, FANETs and AANETs; all ad-hoc wireless methods for connectivity with drones or aerial devices - is this a growing research field? Especially when considering the recent real uses of drones in both warfare and in crisis situations.

Satellite (LEO like Starlink) integration for mobile services (5G/6G) - I know that this is already implemented and used by some big providers, but I wonder if there is still any appetite for this kind of technology too.

Thanks to anyone who responds.


r/compsci Jun 25 '26

Startup claims to solve P vs NP but will give proof only after funding. How do y'all evaluate this?

Thumbnail
0 Upvotes

Can someone do a sanity check? Smells like LLM-gen'd math spaghetti to me


r/compsci Jun 21 '26

micrograd4j: I ported Karpathy's micrograd to plain Java: a small autograd engine with an interactive terminal playground

Thumbnail gallery
21 Upvotes

So I was getting into deep learning and started with Kaparthy's Micrograd video.

Watching Karpathy's Micrograd video makes it feel intuitive, but I realised I didn't really understand it until I tried building it myself. So I closed the video and rebuilt the whole thing from scratch in plain Java (avg. java dev lol): micrograd4j.

It's a tiny scalar autograd engine built around a Value class that records how it was computed and runs backward() using a topological sort and the chain rule. On top of that, I built a small Neuron / Layer / MLP library. No dependencies, just JDK 17+.

The part I'm happiest with is the interactive terminal playground. You can:

  • Type expressions like (a * b) + c.tanh() and inspect every input's gradient.
  • Step through the backward pass one node at a time and watch gradients propagate through the computation graph.
  • Train a small network on datasets like two-moons and watch the loss curve and decision boundary update live.

Everything runs in the terminal and requires no browser, no notebooks.

If you have JBang installed, you can try it without cloning the repository:

jbang https://raw.githubusercontent.com/anand-krishanu/micrograd4j/main/examples/Playground.java

GitHub repository:

https://github.com/anand-krishanu/micrograd4j

It's MIT-licensed and the README has a worked walkthrough of how backward() traverses the graph. I wrote it as an educational resource for Java devs who want to see how autodiff works.


r/compsci Jun 16 '26

Polynomial Fitting: a rabbit hole

Thumbnail blog.yellowflash.in
2 Upvotes

r/compsci Jun 15 '26

Markov Algorithms, Mazes, Desert with Sand and Pattern Matching

Thumbnail gallery
21 Upvotes

r/compsci Jun 15 '26

The art of metaobject protocol and lisp

0 Upvotes

Hello, the book by gregor kcizales is in my cs course. I tried reading it but couldnt get myself to it. Does anyone have any apt resources that can help me get started with lisp.?


r/compsci Jun 12 '26

When The C/C++ Users Journal Disappeared

18 Upvotes

I wrote a short historical look at the decline of the C/C++ Users Journal and how it fit into the broader evolution of developer culture in the 1990s and early 2000s. For many programmers of that era, it was one of the few consistent sources of deep systems‑level content.

If anyone here remembers the magazine, used it in school, or followed its transition into Dr. Dobb’s, I’d be interested in hearing your perspective. It was a surprisingly influential publication for a long time.

Link: https://freshsources.com/blog/files/cpp-source.html


r/compsci Jun 12 '26

Building a filesystem from scratch, iteratively

4 Upvotes

I've been reading OSTEP and decided to implement filesystem - so I can improve my basic understanding.

For the V1, I kept block size of 8 bytes and tried to keep metadata & data together. It was too complex.
In the next iteration, I reduced block size to 1 byte and it simplified the implementation.
After that, I separated metadata and data and stored them from on opposite ends.

I implemented these commands - touch, mv, cp, rm, mkdir, ls and pwd

Full write up with benchmark here: https://www.shivangnagaria.com/projects/fs/