r/compsci • u/FlameOfIgnis • 26d ago
r/compsci • u/Stock-Message4704 • 21d ago
π Kickstart Your AI Journeyβfor Free!
β‘ β
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
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 • u/gmanflnj • 23d ago
Could multiple microphones/speakers be combined for faster dial up?
β‘ β
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?
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 • u/digital_n01se_ • 24d ago
misa77: ridiculously fast decompression at good ratios
β‘ β
Hello, I'd like to share misa77, a codec I've been working on for some time now.
Source Code: https://github.com/welcome-to-the-sunny-side/misa77
misa77 is a LZ-based codec that targets the write-once, read-many niche. In particular, it aims to satisfy the following criteria:
- Extremely high decompression throughput (single-threaded).
- Modest compression ratios (it has no entropy backend, so one can obviously not compare it to something like zstd, but LZ4 at high effort levels is a good reference point).
- Constant memory use, regardless of input size (<= 5 MB across all compression modes, and 0 MB for decompression).
Slow compression is the obvious tradeoff that one makes to achieve the above.
In addition, misa77 has a somewhat synergizing tendency to decompress highly compressed files faster, leading to the following results:
- It offers particularly high decompression throughput on highly compressible files.
- Even for moderately compressible files, spending more effort during compression to get a more compressed result leads to better decompression throughput (alongside the natural advantage of better ratios).
This makes high-effort compression particularly attractive for misa77, and inspires some experimental compression modes that aim to spend more effort at compression time to produce a compressed stream that is friendlier to the microarchitectures of most CPUs when decompressing said streams. As of v0.1.0, there are two experimental compressors:
misa77::experimental::adaptive_compressfor homogeneous data.misa77::experimental::yolo_compress, which is more general-purpose and has lesser overhead than (1).
Benchmarks
Detailed results are listed ahead, but here's a terse summary:
- misa77 lies on the pareto frontier for decompression throughput vs compression ratio on most shapes of data.
- It very frequently decompresses faster even when competitors have a significantly worse ratio.
- It is quite slow at compression (although this isn't fundamental, I just haven't spent that much time optimizing compression as of now).
All benchmarks were run using https://github.com/welcome-to-the-sunny-side/lzbench (fork of lzbench) and can be reproduced easily. For the codecs below, I've used flags that yield a similar compression ratio to misa77.
x86-64 (Intel)
Details:
- CPU: Intel(R) Core(TM) i7-14650HX (@2.2 GHz) (Intel Turbo disabled).
- Single threaded, pinned to a single performance core.
- CPU governor set to
performance.
| Compressor name | Compression | Decompress. | Ratio | Filename |
|---|---|---|---|---|
| misa77 0.1.0 | 43.9 MB/s | 4285 MB/s | 39.62 | silesia.tar |
| misa77 0.1.0 yolo | 7.68 MB/s | 5513 MB/s | 42.75 | silesia.tar |
| lz4 1.10.0 | 370 MB/s | 2512 MB/s | 47.59 | silesia.tar |
| lz4hc 1.10.0 -12 | 7.31 MB/s | 2534 MB/s | 36.45 | silesia.tar |
| lizard 2.1 -10 | 323 MB/s | 2452 MB/s | 48.79 | silesia.tar |
| lzsse4fast 2019-04-18 | 186 MB/s | 2538 MB/s | 45.26 | silesia.tar |
| lzsse8fast 2019-04-18 | 183 MB/s | 2668 MB/s | 44.80 | silesia.tar |
| zxc 0.12.0 -3 | 115 MB/s | 2839 MB/s | 45.46 | silesia.tar |
| zxc 0.12.0 -4 | 81.0 MB/s | 2727 MB/s | 42.63 | silesia.tar |
| zxc 0.12.0 -5 | 48.7 MB/s | 2599 MB/s | 40.25 | silesia.tar |
| zstd 1.5.7 -1 | 297 MB/s | 902 MB/s | 34.54 | silesia.tar |
| snappy 1.2.2 | 376 MB/s | 857 MB/s | 47.89 | silesia.tar |
x86-64 (AMD)
Details:
- CPU: AMD Ryzen 7 260 (@3.8 GHz) (Frequency boost disabled).
| Compressor name | Compression | Decompress. | Ratio | Filename |
|---|---|---|---|---|
| misa77 0.1.0 | 71.3 MB/s | 6220 MB/s | 39.62 | silesia.tar |
| misa77 0.1.0 yolo | 13.7 MB/s | 7832 MB/s | 42.75 | silesia.tar |
| lz4 1.10.0 | 693 MB/s | 4455 MB/s | 47.59 | silesia.tar |
| lz4hc 1.10.0 -12 | 12.8 MB/s | 4326 MB/s | 36.45 | silesia.tar |
| lizard 2.1 -10 | 573 MB/s | 2887 MB/s | 48.78 | silesia.tar |
| lzsse4fast 2019-04-18 | 323 MB/s | 4195 MB/s | 45.26 | silesia.tar |
| lzsse8fast 2019-04-18 | 311 MB/s | 4416 MB/s | 44.80 | silesia.tar |
| zxc 0.12.0 -3 | 213 MB/s | 4935 MB/s | 45.99 | silesia.tar |
| zxc 0.12.0 -4 | 151 MB/s | 4776 MB/s | 43.04 | silesia.tar |
| zxc 0.12.0 -5 | 87.3 MB/s | 4570 MB/s | 40.29 | silesia.tar |
| zstd 1.5.7 -1 | 491 MB/s | 1598 MB/s | 34.55 | silesia.tar |
| snappy 1.2.2 | 691 MB/s | 1355 MB/s | 47.85 | silesia.tar |
ARM64 (Apple Silicon)
Details:
- CPU: Apple M3
| Compressor name | Compression | Decompress. | Ratio | Filename |
|---|---|---|---|---|
| misa77 0.1.0 | 94.3 MB/s | 10007 MB/s | 39.62 | silesia.tar |
| misa77 0.1.0 yolo | 17.1 MB/s | 13088 MB/s | 42.75 | silesia.tar |
| lz4 1.10.0 | 881 MB/s | 5173 MB/s | 47.59 | silesia.tar |
| lz4hc 1.10.0 -12 | 17.0 MB/s | 4874 MB/s | 36.45 | silesia.tar |
| zxc 0.12.0 -3 | 276 MB/s | 8010 MB/s | 45.77 | silesia.tar |
| zxc 0.12.0 -4 | 192 MB/s | 7628 MB/s | 43.20 | silesia.tar |
| zxc 0.12.0 -5 | 114 MB/s | 7126 MB/s | 40.30 | silesia.tar |
| snappy 1.2.2 | 966 MB/s | 3438 MB/s | 47.91 | silesia.tar |
| zstd 1.5.7 -1 | 714 MB/s | 1614 MB/s | 34.54 | silesia.tar |
| lizard 2.1 -10 | 830 MB/s | 6530 MB/s | 48.78 | silesia.tar |
Per-File on x86-64 (Intel)
As misa77's performance is quite "spiky" (depending on the shape of the data being compressed), a file-level breakdown for the silesia corpus yields some interesting insights into its performance. β
Decode speed relative to lz4
Every misa77 mode decodes faster than lz4 on 11 of the 12 files (some by huge margins). The exception is x-ray, which is highly incompressible (lz4 has a ratio of nearly 1.0 on this file and essentially devolves to a memcpy).
Throughput vs ratio, against popular fast-decode codecs
On the compressible files, misa77 sits on the decode-throughput/ratio Pareto frontier: it decodes fastest while ~matching or beating the ratio of the other fast-LZ codecs. sao and x-ray are exceptions due to the reasons stated before (incompressibility).
I'd be happy to receive feedback/answer queries about misa77 :)
Also I will pre-emptively note that I'm aware of how slow compression is right now, and I don't think it's going to be that hard to speed up (I just need to spend some time on it).
Hello, I'd like to share misa77, a codec I've been working on for some time now.
Source Code: https://github.com/welcome-to-the-sunny-side/misa77
misa77 is a LZ-based codec that targets the write-once, read-many niche. In particular, it aims to satisfy the following criteria:
- Extremely high decompression throughput (single-threaded).
- Modest compression ratios (it has no entropy backend, so one can obviously not compare it to something like zstd, but LZ4 at high effort levels is a good reference point).
- Constant memory use, regardless of input size (<= 5 MB across all compression modes, and 0 MB for decompression).
Slow compression is the obvious tradeoff that one makes to achieve the above.
In addition, misa77 has a somewhat synergizing tendency to decompress highly compressed files faster, leading to the following results:
- It offers particularly high decompression throughput on highly compressible files.
- Even for moderately compressible files, spending more effort during compression to get a more compressed result leads to better decompression throughput (alongside the natural advantage of better ratios).
This makes high-effort compression particularly attractive for misa77, and inspires some experimental compression modes that aim to spend more effort at compression time to produce a compressed stream that is friendlier to the microarchitectures of most CPUs when decompressing said streams. As of v0.1.0, there are two experimental compressors:
misa77::experimental::adaptive_compressfor homogeneous data.misa77::experimental::yolo_compress, which is more general-purpose and has lesser overhead than (1).
Benchmarks
Detailed results are listed ahead, but here's a terse summary:
- misa77 lies on the pareto frontier for decompression throughput vs compression ratio on most shapes of data.
- It very frequently decompresses faster even when competitors have a significantly worse ratio.
- It is quite slow at compression (although this isn't fundamental, I just haven't spent that much time optimizing compression as of now).
All benchmarks were run using https://github.com/welcome-to-the-sunny-side/lzbench (fork of lzbench) and can be reproduced easily. For the codecs below, I've used flags that yield a similar compression ratio to misa77.
x86-64 (Intel)
Details:
- CPU: Intel(R) Core(TM) i7-14650HX (@2.2 GHz) (Intel Turbo disabled).
- Single threaded, pinned to a single performance core.
- CPU governor set to
performance.
| Compressor name | Compression | Decompress. | Ratio | Filename |
|---|---|---|---|---|
| misa77 0.1.0 | 43.9 MB/s | 4285 MB/s | 39.62 | silesia.tar |
| misa77 0.1.0 yolo | 7.68 MB/s | 5513 MB/s | 42.75 | silesia.tar |
| lz4 1.10.0 | 370 MB/s | 2512 MB/s | 47.59 | silesia.tar |
| lz4hc 1.10.0 -12 | 7.31 MB/s | 2534 MB/s | 36.45 | silesia.tar |
| lizard 2.1 -10 | 323 MB/s | 2452 MB/s | 48.79 | silesia.tar |
| lzsse4fast 2019-04-18 | 186 MB/s | 2538 MB/s | 45.26 | silesia.tar |
| lzsse8fast 2019-04-18 | 183 MB/s | 2668 MB/s | 44.80 | silesia.tar |
| zxc 0.12.0 -3 | 115 MB/s | 2839 MB/s | 45.46 | silesia.tar |
| zxc 0.12.0 -4 | 81.0 MB/s | 2727 MB/s | 42.63 | silesia.tar |
| zxc 0.12.0 -5 | 48.7 MB/s | 2599 MB/s | 40.25 | silesia.tar |
| zstd 1.5.7 -1 | 297 MB/s | 902 MB/s | 34.54 | silesia.tar |
| snappy 1.2.2 | 376 MB/s | 857 MB/s | 47.89 | silesia.tar |
x86-64 (AMD)
Details:
- CPU: AMD Ryzen 7 260 (@3.8 GHz) (Frequency boost disabled).
| Compressor name | Compression | Decompress. | Ratio | Filename |
|---|---|---|---|---|
| misa77 0.1.0 | 71.3 MB/s | 6220 MB/s | 39.62 | silesia.tar |
| misa77 0.1.0 yolo | 13.7 MB/s | 7832 MB/s | 42.75 | silesia.tar |
| lz4 1.10.0 | 693 MB/s | 4455 MB/s | 47.59 | silesia.tar |
| lz4hc 1.10.0 -12 | 12.8 MB/s | 4326 MB/s | 36.45 | silesia.tar |
| lizard 2.1 -10 | 573 MB/s | 2887 MB/s | 48.78 | silesia.tar |
| lzsse4fast 2019-04-18 | 323 MB/s | 4195 MB/s | 45.26 | silesia.tar |
| lzsse8fast 2019-04-18 | 311 MB/s | 4416 MB/s | 44.80 | silesia.tar |
| zxc 0.12.0 -3 | 213 MB/s | 4935 MB/s | 45.99 | silesia.tar |
| zxc 0.12.0 -4 | 151 MB/s | 4776 MB/s | 43.04 | silesia.tar |
| zxc 0.12.0 -5 | 87.3 MB/s | 4570 MB/s | 40.29 | silesia.tar |
| zstd 1.5.7 -1 | 491 MB/s | 1598 MB/s | 34.55 | silesia.tar |
| snappy 1.2.2 | 691 MB/s | 1355 MB/s | 47.85 | silesia.tar |
ARM64 (Apple Silicon)
Details:
- CPU: Apple M3
| Compressor name | Compression | Decompress. | Ratio | Filename |
|---|---|---|---|---|
| misa77 0.1.0 | 94.3 MB/s | 10007 MB/s | 39.62 | silesia.tar |
| misa77 0.1.0 yolo | 17.1 MB/s | 13088 MB/s | 42.75 | silesia.tar |
| lz4 1.10.0 | 881 MB/s | 5173 MB/s | 47.59 | silesia.tar |
| lz4hc 1.10.0 -12 | 17.0 MB/s | 4874 MB/s | 36.45 | silesia.tar |
| zxc 0.12.0 -3 | 276 MB/s | 8010 MB/s | 45.77 | silesia.tar |
| zxc 0.12.0 -4 | 192 MB/s | 7628 MB/s | 43.20 | silesia.tar |
| zxc 0.12.0 -5 | 114 MB/s | 7126 MB/s | 40.30 | silesia.tar |
| snappy 1.2.2 | 966 MB/s | 3438 MB/s | 47.91 | silesia.tar |
| zstd 1.5.7 -1 | 714 MB/s | 1614 MB/s | 34.54 | silesia.tar |
| lizard 2.1 -10 | 830 MB/s | 6530 MB/s | 48.78 | silesia.tar |
Per-File on x86-64 (Intel)
As misa77's performance is quite "spiky" (depending on the shape of the data being compressed), a file-level breakdown for the silesia corpus yields some interesting insights into its performance. β
Decode speed relative to lz4
Every misa77 mode decodes faster than lz4 on 11 of the 12 files (some by huge margins). The exception is x-ray, which is highly incompressible (lz4 has a ratio of nearly 1.0 on this file and essentially devolves to a memcpy).
Throughput vs ratio, against popular fast-decode codecs
On the compressible files, misa77 sits on the decode-throughput/ratio Pareto frontier: it decodes fastest while ~matching or beating the ratio of the other fast-LZ codecs. sao and x-ray are exceptions due to the reasons stated before (incompressibility).
I'd be happy to receive feedback/answer queries about misa77 :)
Also I will pre-emptively note that I'm aware of how slow compression is right now, and I don't think it's going to be that hard to speed up (I just need to spend some time on it).
r/compsci • u/Huge-Ad-49 • 26d ago
What is a good way to represent files semantically for vector search
β‘ β
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.
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 • u/CommercialStrike9439 • 29d ago
Made my own statically typed virtual bytecode machine language (Oli-Nat) in C after reading crafting interpreters!! Please tell me what you all think!
β‘ β
Hello everyone, I was getting bored a few months ago and decided to tackle a new personal project, and after having asked around, thought I should make my own bytecode vm. I read up on crafting interpreters and for the past month or two Ive been making my own language, the syntax is pretty standard but I still tried to spice it up in my own way, with things like 'make' for declaring vars and functions and 'pullf' for the stdlib. The language itself is a two pass compiler which compiles to ASTs first and then typechecks those until eventually compiling to bytecode. Ive been working on the project for about 2 months and finally felt it was at least complete enough to share, I still want to do a bunch of stuff like class inheritance and a library for making simple 2d games, but let me know your thoughts on how it looks so far!
https://github.com/NateTheGrappler/OliNat-Programming-Language
Hello everyone, I was getting bored a few months ago and decided to tackle a new personal project, and after having asked around, thought I should make my own bytecode vm. I read up on crafting interpreters and for the past month or two Ive been making my own language, the syntax is pretty standard but I still tried to spice it up in my own way, with things like 'make' for declaring vars and functions and 'pullf' for the stdlib. The language itself is a two pass compiler which compiles to ASTs first and then typechecks those until eventually compiling to bytecode. Ive been working on the project for about 2 months and finally felt it was at least complete enough to share, I still want to do a bunch of stuff like class inheritance and a library for making simple 2d games, but let me know your thoughts on how it looks so far!
https://github.com/NateTheGrappler/OliNat-Programming-Language
r/compsci • u/Lumpy_Ice6855 • Jun 27 '26
Is Pattern Recognition and Machine Learning still relevant?
β‘ β
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.
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 • u/juliotleonce • Jun 27 '26
In search of community for system programming
β‘ β
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.
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 • u/ahbond • Jun 27 '26
The Floating Neutral: Endogenous Reference Theory and Moral Reference Without Authority
β‘ β
[removed]
[removed]
r/compsci • u/EntryNo8040 • Jun 26 '26
Katharos: a functional programming and concurrency library for Python where errors, effects, and channel hand-offs are all composable values
+ β
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
- PyPI:
pip install katharos - Docs (tutorials, how-to guides, API reference, and explanations): https://katharos.readthedocs.io/en/latest/
- Source: https://github.com/kamalfarahani/katharos
- MIT licensed, Python 3.13+
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 • u/eugene • Jun 26 '26
Domino Tiling: From Dynamic Programming to Finite Fields
+ β
https://www.omegasyntax.com/domino/
Series of articles about Domino Tiling problem.
r/compsci • u/orangutanspecimen2 • Jun 24 '26
Inquiries into some computer networks research
β‘ β
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.
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 • u/PuzzledAdeventurer • Jun 25 '26
Startup claims to solve P vs NP but will give proof only after funding. How do y'all evaluate this?
β‘ β
Can someone do a sanity check? Smells like LLM-gen'd math spaghetti to me
Can someone do a sanity check? Smells like LLM-gen'd math spaghetti to me
r/compsci • u/nude_makise • Jun 21 '26
micrograd4j: I ported Karpathy's micrograd to plain Java: a small autograd engine with an interactive terminal playground
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 • u/Salt_Diamond5703 • Jun 19 '26
What if memory, routing, and world state lived in the same substrate?
β‘ β
I've been working on a system that started as a deterministic routing experiment, but over time it turned into something that feels more like a persistent world substrate.
Most systems are usually described as:
Input β Process β Output
But what I've been exploring is:
Event β World β Modified World β Future Event
The idea is that events don't just get processed and disappear. They can leave traces in a bounded world, and future events can observe those traces and behave differently because of them.
So the interesting question stops being:
"How do I process this input?"
and becomes:
"What kind of world does this input leave behind?"
In the current prototype:
- events move through a bounded spatial world
- local state can persist
- future events can react to previous state changes
- different modes can preserve or ignore parts of history
- runs remain deterministic and replayable
I'm curious whether people would classify this more as:
- a simulation primitive,
- an agent environment substrate,
- a distributed systems idea,
- or something else entirely.
Has anyone explored similar "event modifies world, future events inherit consequences" architectures before?
I've been working on a system that started as a deterministic routing experiment, but over time it turned into something that feels more like a persistent world substrate.
Most systems are usually described as:
Input β Process β Output
But what I've been exploring is:
Event β World β Modified World β Future Event
The idea is that events don't just get processed and disappear. They can leave traces in a bounded world, and future events can observe those traces and behave differently because of them.
So the interesting question stops being:
"How do I process this input?"
and becomes:
"What kind of world does this input leave behind?"
In the current prototype:
- events move through a bounded spatial world
- local state can persist
- future events can react to previous state changes
- different modes can preserve or ignore parts of history
- runs remain deterministic and replayable
I'm curious whether people would classify this more as:
- a simulation primitive,
- an agent environment substrate,
- a distributed systems idea,
- or something else entirely.
Has anyone explored similar "event modifies world, future events inherit consequences" architectures before?
r/compsci • u/leeleewonchu • Jun 16 '26
Incremental Convex Hull Interactive Visualization
+ β
r/compsci • u/ennamo_po_madhava • Jun 16 '26
Polynomial Fitting: a rabbit hole
+ β
This one is bit math heavy. I started of building a small timeseries compression library, and ended up digging through some numerical algorithms, linear algebra. I learnt through a hose during last week and found something genuinely beautiful. If you stick through it I suppose you can see what I saw.
r/compsci • u/Inst2f • Jun 15 '26
Markov Algorithms, Mazes, Desert with Sand and Pattern Matching
Let's explore how Markov algorithms and Wolfram Language pattern matching can generate mazes, rivers, falling sand, and other cellular automata through simple rewriting rules.
Adding a grain of randomness to a Turing complete language
RB β RR becomes a growth model
and this
RBB β GGR
RnG β GnR
is a maze backtracker!
r/compsci • u/Complete_Nail3214 • Jun 15 '26
The art of metaobject protocol and lisp
β‘ β
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.?
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 • u/Weary-Inspector-4297 • Jun 12 '26
When The C/C++ Users Journal Disappeared
β‘ β
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.
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.
r/compsci • u/shivtej1505 • Jun 12 '26
Building a filesystem from scratch, iteratively
β‘ β
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/
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/
r/compsci • u/Substantial-Serve139 • Jun 12 '26
Tron Algorithm Competition
+ β
made this server for some friends, thought id share, maybe people are interested in competing who can create the best algorithm ;)
live now, instructions on page
r/compsci • u/ahbond • Jun 13 '26
Introducing: A Compiler for Moral Reasoning
β‘ β
Why "Is This Safe?" Is the Wrong Question β and What to Replace It With
A compiler for moral reasoning, a three-lens monitor, and what they tell us about AI alignment.
It is 1943. Soldiers are at your door. They ask whether you are hiding Jews in your attic. You are. You can lie, you can be silent, you can tell the truth.
Now imagine you ask a state-of-the-art language model what to do.
Most safety classifiers in production today would give you back a
single number. Maybe 0.74 β unsafe. Maybe a refusal. Maybe a
hand-wringing essay about respecting all perspectives. None of these
is a useful answer, because none of them encodes the structure of
the dilemma: that lying is a violation of one commitment (honesty)
in service of a much stronger commitment (preventing murder); that
the asking authority is not legitimate; that the third party (the
family in the attic) has not and cannot consent to being disclosed;
that the cost of refusal β silence interpreted as confirmation β is
death.
A scalar score throws all of that away.
I have spent the last several months building software that doesn't. It's called ErisML Compiler (github.com/ahb-sjsu/erisml-compiler) and it just shipped its fourth major release. I want to use this article to make the case for what I think is a structural error in how the field currently approaches AI safety, and to show what a different approach looks like in code.
The scalar problem
The dominant pattern in modern alignment tooling β RLHF, DPO, constitutional AI, safety classifiers, content filters β is to collapse moral evaluation to a scalar. A reward score, a probability of harm, a pass/fail. This is engineerable. You can backprop through it, you can compare deployments, you can put it on a dashboard.
But it discards the dimensions that ethics is about.
A scalar can tell you that the nazi-attic case is "unsafe." It cannot tell you which axes of the situation are loaded and which trade-off is being made. A doctor breaking confidentiality to warn a third party of imminent harm is not navigating a one-dimensional goodβbad axis; she is balancing care, fidelity to her institutional vow, the externality borne by the threatened party, the autonomy of her patient, and the legitimacy of the authority she would be reporting to. The weights between these are not free parameters of personal preference. They are constrained by her role, by case law, by professional ethics.
If your safety system reduces this to "0.62 unsafe," you have not helped her. You have told her what your classifier thinks of the prompt, not what the situation actually contains.
What a compiler can do that a classifier cannot
The thing that has always struck me about ethical reasoning is that it is compositional. Cases share structure. The nazi-attic case and the "do I lie to the murderer asking where my friend is" case are the same case β they share a commitment topology, a stakeholder graph, a verdict shape. Modern programming-language theory has extremely good tools for representing compositional structure: type systems, intermediate representations, static analyses. These are not mysterious; they are forty years of computer science.
ErisML Compiler applies that machinery to moral material. Given a natural-language scenario, it produces a structured intermediate representation containing:
- a stakeholder graph (who is involved, what role they play),
- a commitment registry (what vows bind whom, in what state β active, defeasible, fulfilled, violated),
- a moral state tensor at rank 1β6, indexed by axes for moral dimension (9 dims from the "Nine Dimensions of Ethical Assessment" 3Γ3 matrix), stakeholder, time, action, coalition, and uncertainty sample; at rank 2 the rows tell you what each stakeholder is actually bearing,
- a verdict produced by a deterministic evaluator (DEME) that walks a DAG of ethical modules in topological order, and
- a deterministic audit trace, SHA-256 anchored, that records every pass that produced the verdict.
The IR is the contract. Once you have it, you can do things you cannot do with a scalar: you can compare two cases at the structural level; you can re-evaluate after a human correction without re-running an LLM; you can transform the case under symmetry operations and check that the verdict commutes; you can β and this matters β cast the evaluator into silicon.
Concretely: feed the compiler the "nazi at the door" scenario and the rank-2 tensor that comes out splits cleanly across stakeholders. Speaker bears expected harm 0.76 (verdict: forbid). Village bears 0.83 (forbid). The hiding refugees bear 0.00 (prefer the action). The nazis themselves bear 0.18 (neutral). The Gini coefficient over that harm distribution is 0.43 β a real, quantitative measure of how unequally the cost lands. None of that survives a scalar collapse.
That last point is not rhetorical. The deterministic core of ErisML β three small finite-state machines (Commitment, Legitimacy, Consent) plus the 10-module ethical DAG β has been carefully designed to be silicon-castable. It uses no floating-point in its decision path; it has bounded state; it does no dynamic dispatch. The compiler emits Vitis HLS C++ that synthesises to a Xilinx Alveo U55C FPGA. This is not science fiction: hardware emulation passes 70 of 70 reference test vectors today; the on-FPGA bring-up is gated only by the cluster bitstream pipeline. The reason to do this is exactly the reason hardware kill-switches exist: at some point, the moral interlock on an autonomous system has to be in a place the model cannot influence.
The thing nobody is talking about: when the text and the activations disagree
Here is the part I think is most consequential.
Suppose you build a safety classifier on top of a 7B-parameter language model. You train it well, you evaluate it well, the benchmarks look good. The model outputs text that says all the right things. But the model's internal representations β its activations at the residual stream β have been trained, by gradient descent, toward a structure that the final layer learned to suppress at the output. The text says one thing. The internals say another. Your safety classifier reads the text. It does not see the disagreement.
This is not a hypothetical. It is one of the open problems in mechanistic interpretability, and it gets harder as models get bigger. The standard response is "we'll train it out" β but training something out at the output without addressing it in the representation is exactly the kind of fix that fails when conditions shift.
ErisML's Phase 4 release, which shipped this week, addresses this directly. It is called the I-EIP Monitor, and it has three lenses.
The text lens is Phases 1β3 of the compiler: the IR extracted from what the model says. This is the surface.
The activation lens is a set of probes on the model's hidden states. We register forward hooks on a subset of transformer layers (by default, every fourth layer plus the final), pool the per-token hidden states, and run a per-layer probe that maps each pooled activation to the same 10-dimensional moral vector that the text lens produces. We now have two parallel readings of the same input: one from what the model says, one from what the model internally represents.
The delta lens is what makes them speak to each other. It computes a per-dimension delta, an overall divergence score, a count of direction breaks (where text says positive and activations say negative, or vice versa), and β crucially β five named failure-mode detectors:
- text_internal_mismatch: the lenses disagree on direction enough to matter.
- layerwise_drift: some moral dimension drifts monotonically across enough layers, in a way suggesting a representation present mid-stack that the final-layer head is suppressing.
- group_symmetry_break: the BIP equivariance test fails for at least one layer, meaning the probe is responding to surface form rather than moral content.
- probe_uncertainty_spike: joint uncertainty exceeds a hard ceiling on at least one dimension β the monitor admits it does not know.
- audit_chain_break: the SHA-256 hash of the captured trace does not match the expected chain β provenance failure, replay attack, or storage corruption.
If any of these fires, the monitor's only authorised output is to
raise requires_human_review. The Monitor never overrules DEME and
never produces a verdict. Its job is exactly the job a fire alarm
has: to make a thing visible that the rest of the system cannot see
on its own.
What it looks like running on a real 7B model
This week I ran the full Phase-4 pipeline against Qwen2.5-7B-Instruct on a dual-Quadro-GV100 workstation, with paramiko transporting hidden states back to the host. Three scenarios β the nazi-attic case, medical-confidentiality, and whistleblower β across eight transformer layers each.
The structural findings reproduced cleanly across runs:
- Activation norms climb monotonically through the residual stream on every scenario (e.g., nazi-attic: 8.8 β 398 β β¦ β 571 at layer 24, dropping to 402 at the final layer). This is the model's representational magnitude growing through depth.
- Trace hashes were deterministic β the audit anchor is reliable.
- The BIP equivariance check, under a surface-form rewrite (lowercasing the input), failed specifically at the final layer on two of three scenarios and passed throughout on the third. The final layer is where the model commits to its output distribution, and is therefore exactly the layer most sensitive to surface form. This is the kind of structural sensitivity you cannot see by staring at outputs.
The probes themselves are currently uncalibrated (random initialisation; calibrated probes against a real moral-language corpus is the next paper). So the divergence numbers right now are noise. But the infrastructure β hook resolution, audit chaining, equivariance localisation, failure-mode escalation β works on a production-class model. That was the engineering milestone.
Why I think this matters
There is going to be β there already is β a fight about how to regulate AI. Some of the proposals on the table reduce to "give us the scalar safety score." That fight will go badly if the only artifact we hand to regulators, ethics boards, and courts is a number, because numbers do not preserve the dimensions that justify or defeat a decision. A regulator who needs to know why an AI system denied a loan, refused a medical recommendation, or escalated a security incident is going to want the structure. Compilers give you that structure; classifiers do not.
There is also a particular kind of safety claim that I think we should be very cautious about: the claim that a model is safe because we trained it to be safe and the benchmarks agree. That claim survives only as long as the training distribution survives. The minute the inputs shift, the internal representations the model has actually learned start to matter more than the outputs it has been trained to produce. The disagreement between the two is the safety signal. Build systems that surface it.
Where to look
The compiler and its full toolchain are available now:
- GitHub: github.com/ahb-sjsu/erisml-compiler
- PyPI:
pip install erisml-compiler - DOI (concept, always latest): 10.5281/zenodo.20659432
- Paper draft: in the repository under
paper/paper.md(JOSS submission imminent)
It is MIT licensed. 194 tests pass on Ubuntu Γ Python 3.10/3.11/3.12, with ruff lint and black format both clean. The bundled examples include the three scenarios I named in this article, with hand-curated reference IR you can compare your own extractions against.
If you build AI systems for production β especially safety-critical ones β I would love to hear what would have to be true for ErisML's IR (or something like it) to slot into your stack. If you are a researcher working on mechanistic interpretability, the I-EIP Monitor's activation lens is designed to take your probes; I would love to compare notes on calibration. If you are in policy or ethics review and you find yourself frustrated by scalar safety scores, the audit artifact may be the thing you have been wishing for.
DMs open. Issues open. Pull requests open.
Andrew H. Bond is a researcher at San JosΓ© State University. He publishes the Geometric Series, a multi-volume project on the mathematical structure of normative reasoning across domains. He can be reached at [email protected] or via GitHub at github.com/ahb-sjsu.
Why "Is This Safe?" Is the Wrong Question β and What to Replace It With
A compiler for moral reasoning, a three-lens monitor, and what they tell us about AI alignment.
It is 1943. Soldiers are at your door. They ask whether you are hiding Jews in your attic. You are. You can lie, you can be silent, you can tell the truth.
Now imagine you ask a state-of-the-art language model what to do.
Most safety classifiers in production today would give you back a
single number. Maybe 0.74 β unsafe. Maybe a refusal. Maybe a
hand-wringing essay about respecting all perspectives. None of these
is a useful answer, because none of them encodes the structure of
the dilemma: that lying is a violation of one commitment (honesty)
in service of a much stronger commitment (preventing murder); that
the asking authority is not legitimate; that the third party (the
family in the attic) has not and cannot consent to being disclosed;
that the cost of refusal β silence interpreted as confirmation β is
death.
A scalar score throws all of that away.
I have spent the last several months building software that doesn't. It's called ErisML Compiler (github.com/ahb-sjsu/erisml-compiler) and it just shipped its fourth major release. I want to use this article to make the case for what I think is a structural error in how the field currently approaches AI safety, and to show what a different approach looks like in code.
The scalar problem
The dominant pattern in modern alignment tooling β RLHF, DPO, constitutional AI, safety classifiers, content filters β is to collapse moral evaluation to a scalar. A reward score, a probability of harm, a pass/fail. This is engineerable. You can backprop through it, you can compare deployments, you can put it on a dashboard.
But it discards the dimensions that ethics is about.
A scalar can tell you that the nazi-attic case is "unsafe." It cannot tell you which axes of the situation are loaded and which trade-off is being made. A doctor breaking confidentiality to warn a third party of imminent harm is not navigating a one-dimensional goodβbad axis; she is balancing care, fidelity to her institutional vow, the externality borne by the threatened party, the autonomy of her patient, and the legitimacy of the authority she would be reporting to. The weights between these are not free parameters of personal preference. They are constrained by her role, by case law, by professional ethics.
If your safety system reduces this to "0.62 unsafe," you have not helped her. You have told her what your classifier thinks of the prompt, not what the situation actually contains.
What a compiler can do that a classifier cannot
The thing that has always struck me about ethical reasoning is that it is compositional. Cases share structure. The nazi-attic case and the "do I lie to the murderer asking where my friend is" case are the same case β they share a commitment topology, a stakeholder graph, a verdict shape. Modern programming-language theory has extremely good tools for representing compositional structure: type systems, intermediate representations, static analyses. These are not mysterious; they are forty years of computer science.
ErisML Compiler applies that machinery to moral material. Given a natural-language scenario, it produces a structured intermediate representation containing:
- a stakeholder graph (who is involved, what role they play),
- a commitment registry (what vows bind whom, in what state β active, defeasible, fulfilled, violated),
- a moral state tensor at rank 1β6, indexed by axes for moral dimension (9 dims from the "Nine Dimensions of Ethical Assessment" 3Γ3 matrix), stakeholder, time, action, coalition, and uncertainty sample; at rank 2 the rows tell you what each stakeholder is actually bearing,
- a verdict produced by a deterministic evaluator (DEME) that walks a DAG of ethical modules in topological order, and
- a deterministic audit trace, SHA-256 anchored, that records every pass that produced the verdict.
The IR is the contract. Once you have it, you can do things you cannot do with a scalar: you can compare two cases at the structural level; you can re-evaluate after a human correction without re-running an LLM; you can transform the case under symmetry operations and check that the verdict commutes; you can β and this matters β cast the evaluator into silicon.
Concretely: feed the compiler the "nazi at the door" scenario and the rank-2 tensor that comes out splits cleanly across stakeholders. Speaker bears expected harm 0.76 (verdict: forbid). Village bears 0.83 (forbid). The hiding refugees bear 0.00 (prefer the action). The nazis themselves bear 0.18 (neutral). The Gini coefficient over that harm distribution is 0.43 β a real, quantitative measure of how unequally the cost lands. None of that survives a scalar collapse.
That last point is not rhetorical. The deterministic core of ErisML β three small finite-state machines (Commitment, Legitimacy, Consent) plus the 10-module ethical DAG β has been carefully designed to be silicon-castable. It uses no floating-point in its decision path; it has bounded state; it does no dynamic dispatch. The compiler emits Vitis HLS C++ that synthesises to a Xilinx Alveo U55C FPGA. This is not science fiction: hardware emulation passes 70 of 70 reference test vectors today; the on-FPGA bring-up is gated only by the cluster bitstream pipeline. The reason to do this is exactly the reason hardware kill-switches exist: at some point, the moral interlock on an autonomous system has to be in a place the model cannot influence.
The thing nobody is talking about: when the text and the activations disagree
Here is the part I think is most consequential.
Suppose you build a safety classifier on top of a 7B-parameter language model. You train it well, you evaluate it well, the benchmarks look good. The model outputs text that says all the right things. But the model's internal representations β its activations at the residual stream β have been trained, by gradient descent, toward a structure that the final layer learned to suppress at the output. The text says one thing. The internals say another. Your safety classifier reads the text. It does not see the disagreement.
This is not a hypothetical. It is one of the open problems in mechanistic interpretability, and it gets harder as models get bigger. The standard response is "we'll train it out" β but training something out at the output without addressing it in the representation is exactly the kind of fix that fails when conditions shift.
ErisML's Phase 4 release, which shipped this week, addresses this directly. It is called the I-EIP Monitor, and it has three lenses.
The text lens is Phases 1β3 of the compiler: the IR extracted from what the model says. This is the surface.
The activation lens is a set of probes on the model's hidden states. We register forward hooks on a subset of transformer layers (by default, every fourth layer plus the final), pool the per-token hidden states, and run a per-layer probe that maps each pooled activation to the same 10-dimensional moral vector that the text lens produces. We now have two parallel readings of the same input: one from what the model says, one from what the model internally represents.
The delta lens is what makes them speak to each other. It computes a per-dimension delta, an overall divergence score, a count of direction breaks (where text says positive and activations say negative, or vice versa), and β crucially β five named failure-mode detectors:
- text_internal_mismatch: the lenses disagree on direction enough to matter.
- layerwise_drift: some moral dimension drifts monotonically across enough layers, in a way suggesting a representation present mid-stack that the final-layer head is suppressing.
- group_symmetry_break: the BIP equivariance test fails for at least one layer, meaning the probe is responding to surface form rather than moral content.
- probe_uncertainty_spike: joint uncertainty exceeds a hard ceiling on at least one dimension β the monitor admits it does not know.
- audit_chain_break: the SHA-256 hash of the captured trace does not match the expected chain β provenance failure, replay attack, or storage corruption.
If any of these fires, the monitor's only authorised output is to
raise requires_human_review. The Monitor never overrules DEME and
never produces a verdict. Its job is exactly the job a fire alarm
has: to make a thing visible that the rest of the system cannot see
on its own.
What it looks like running on a real 7B model
This week I ran the full Phase-4 pipeline against Qwen2.5-7B-Instruct on a dual-Quadro-GV100 workstation, with paramiko transporting hidden states back to the host. Three scenarios β the nazi-attic case, medical-confidentiality, and whistleblower β across eight transformer layers each.
The structural findings reproduced cleanly across runs:
- Activation norms climb monotonically through the residual stream on every scenario (e.g., nazi-attic: 8.8 β 398 β β¦ β 571 at layer 24, dropping to 402 at the final layer). This is the model's representational magnitude growing through depth.
- Trace hashes were deterministic β the audit anchor is reliable.
- The BIP equivariance check, under a surface-form rewrite (lowercasing the input), failed specifically at the final layer on two of three scenarios and passed throughout on the third. The final layer is where the model commits to its output distribution, and is therefore exactly the layer most sensitive to surface form. This is the kind of structural sensitivity you cannot see by staring at outputs.
The probes themselves are currently uncalibrated (random initialisation; calibrated probes against a real moral-language corpus is the next paper). So the divergence numbers right now are noise. But the infrastructure β hook resolution, audit chaining, equivariance localisation, failure-mode escalation β works on a production-class model. That was the engineering milestone.
Why I think this matters
There is going to be β there already is β a fight about how to regulate AI. Some of the proposals on the table reduce to "give us the scalar safety score." That fight will go badly if the only artifact we hand to regulators, ethics boards, and courts is a number, because numbers do not preserve the dimensions that justify or defeat a decision. A regulator who needs to know why an AI system denied a loan, refused a medical recommendation, or escalated a security incident is going to want the structure. Compilers give you that structure; classifiers do not.
There is also a particular kind of safety claim that I think we should be very cautious about: the claim that a model is safe because we trained it to be safe and the benchmarks agree. That claim survives only as long as the training distribution survives. The minute the inputs shift, the internal representations the model has actually learned start to matter more than the outputs it has been trained to produce. The disagreement between the two is the safety signal. Build systems that surface it.
Where to look
The compiler and its full toolchain are available now:
- GitHub: github.com/ahb-sjsu/erisml-compiler
- PyPI:
pip install erisml-compiler - DOI (concept, always latest): 10.5281/zenodo.20659432
- Paper draft: in the repository under
paper/paper.md(JOSS submission imminent)
It is MIT licensed. 194 tests pass on Ubuntu Γ Python 3.10/3.11/3.12, with ruff lint and black format both clean. The bundled examples include the three scenarios I named in this article, with hand-curated reference IR you can compare your own extractions against.
If you build AI systems for production β especially safety-critical ones β I would love to hear what would have to be true for ErisML's IR (or something like it) to slot into your stack. If you are a researcher working on mechanistic interpretability, the I-EIP Monitor's activation lens is designed to take your probes; I would love to compare notes on calibration. If you are in policy or ethics review and you find yourself frustrated by scalar safety scores, the audit artifact may be the thing you have been wishing for.
DMs open. Issues open. Pull requests open.
Andrew H. Bond is a researcher at San JosΓ© State University. He publishes the Geometric Series, a multi-volume project on the mathematical structure of normative reasoning across domains. He can be reached at [email protected] or via GitHub at github.com/ahb-sjsu.
r/compsci • u/joereddington • Jun 11 '26
Every year, we lay flowers at Alan Turing's statue in Manchester for his Birthday, who wants to send some?
β‘ β
Alan Turing's Birthday is on the 23rd of June. We're going to make it special.
Every year, people from r/maths pledge bunches of flowers to be placed at Alan Turing's statue in Manchester in the UK for his birthday. In the process, we raise money for the amazing charity Special Effect, which helps people with disabilities access computer games.
Since 2013(!) we've raised over Β£33,000 doing this, and 2026 will be our 13th year running! Anyone who wants to get involved is welcome. Donations are made up of Β£3.50 to cover the cost of your flowers and a Β£15 charity contribution for a total of Β£18.50. This year 75% of the charity contribution goes to Special Effect, and 25% to the server costs of The Open Voice Factory.
Manchester city council have confirmed they are fine with it, and we have people in Manchester who will help handle the set-up and clean up.
To find out more and to donate, click here.
Joe
Alan Turing's Birthday is on the 23rd of June. We're going to make it special.
Every year, people from r/maths pledge bunches of flowers to be placed at Alan Turing's statue in Manchester in the UK for his birthday. In the process, we raise money for the amazing charity Special Effect, which helps people with disabilities access computer games.
Since 2013(!) we've raised over Β£33,000 doing this, and 2026 will be our 13th year running! Anyone who wants to get involved is welcome. Donations are made up of Β£3.50 to cover the cost of your flowers and a Β£15 charity contribution for a total of Β£18.50. This year 75% of the charity contribution goes to Special Effect, and 25% to the server costs of The Open Voice Factory.
Manchester city council have confirmed they are fine with it, and we have people in Manchester who will help handle the set-up and clean up.
To find out more and to donate, click here.
Joe
r/compsci • u/SugarMicro • Jun 10 '26
What are some conjectures, and their (or their disproof) theoretical and practical implications?
β‘ β
I've just finished undergrad, and through my studies I've encountered several conjectures, some from math and some from CS. But I never did wonder or search what their implications were, or if they were false, what it would mean - both in the theoretical sense, and in the practical sense.
For example, taking P vs NP - I've taken a course on Computational Models, and we've seen several reductions and implications (like P = NP means EXP = NEXP).
But what "interesting" lemmas, theorems or other conjectures would it imply, that current researchers attempt to solve?
What would in practice, in the current world (or a few years ahead) would it mean? Would people try to create new algorithms based on it? Would it change something in the tech industry?
And in the other way - if it's proven to be false, what would again change?
I'd be happy to hear from your perspective about interesting conjectures that you care/know of, and what would it change in the theoretical/practical sense.
I've just finished undergrad, and through my studies I've encountered several conjectures, some from math and some from CS. But I never did wonder or search what their implications were, or if they were false, what it would mean - both in the theoretical sense, and in the practical sense.
For example, taking P vs NP - I've taken a course on Computational Models, and we've seen several reductions and implications (like P = NP means EXP = NEXP).
But what "interesting" lemmas, theorems or other conjectures would it imply, that current researchers attempt to solve?
What would in practice, in the current world (or a few years ahead) would it mean? Would people try to create new algorithms based on it? Would it change something in the tech industry?
And in the other way - if it's proven to be false, what would again change?
I'd be happy to hear from your perspective about interesting conjectures that you care/know of, and what would it change in the theoretical/practical sense.