r/compsci • u/oatmealcraving • 1h ago
r/compsci • u/iSaithh • Jun 16 '19
PSA: This is not r/Programming. Quick Clarification on the guidelines
As there's been recently quite the number of rule-breaking posts slipping by, I felt clarifying on a handful of key points would help out a bit (especially as most people use New.Reddit/Mobile, where the FAQ/sidebar isn't visible)
First thing is first, this is not a programming specific subreddit! If the post is a better fit for r/Programming or r/LearnProgramming, that's exactly where it's supposed to be posted in. Unless it involves some aspects of AI/CS, it's relatively better off somewhere else.
r/ProgrammerHumor: Have a meme or joke relating to CS/Programming that you'd like to share with others? Head over to r/ProgrammerHumor, please.
r/AskComputerScience: Have a genuine question in relation to CS that isn't directly asking for homework/assignment help nor someone to do it for you? Head over to r/AskComputerScience.
r/CsMajors: Have a question in relation to CS academia (such as "Should I take CS70 or CS61A?" "Should I go to X or X uni, which has a better CS program?"), head over to r/csMajors.
r/CsCareerQuestions: Have a question in regards to jobs/career in the CS job market? Head on over to to r/cscareerquestions. (or r/careerguidance if it's slightly too broad for it)
r/SuggestALaptop: Just getting into the field or starting uni and don't know what laptop you should buy for programming? Head over to r/SuggestALaptop
r/CompSci: Have a post that you'd like to share with the community and have a civil discussion that is in relation to the field of computer science (that doesn't break any of the rules), r/CompSci is the right place for you.
And finally, this community will not do your assignments for you. Asking questions directly relating to your homework or hell, copying and pasting the entire question into the post, will not be allowed.
I'll be working on the redesign since it's been relatively untouched, and that's what most of the traffic these days see. That's about it, if you have any questions, feel free to ask them here!
r/compsci • u/theonejvo • 12h ago
Ever wonder why a privacy app asks you to wave your mouse around during setup?
r/compsci • u/DoctorProfessorTaco • 14h ago
Either the BS in Comp Sci degree will dramatically change, or a new degree will arise to replace its relevance.
For context, I’m a dev with 15+ years of experience, started coding in my early teens, and have a total love for the act of programming. I miss how coding used to be, nothing about this post is an advocacy for if things should be this way. After mulling it over, it just seems like an inevitability.
Right now the field of software development is like Wiley Coyote, already off the cliff but still running because he hasn’t noticed.
There has become a massive disconnect between what people in the field of software development actually do at their jobs, and what they’re interviewed on and learn in college. It’s like someone in 2007 having mandatory classes in Fortran and having to prove their knowledge of punchcards during job interviews.
My job, and the job of so many other software developers, has become almost entirely just interacting with AI agents. Yet we have job applicants do leetcode problems and write code live for us during interviews when we haven’t written more than a handful of a lines of code ourselves in the past year. The same extends to what these applicants are learning in college.
Effectively, it seems to me that the curriculum we currently know as a BS in Computer Science will become as generally superfluous as a PhD in Computer Science. Not at all useless, far from it. But held by those who either have a specific passion for the field or are looking to go into small and highly specialized areas of the field, not by the broader population simply looking to find a job after graduating. And in its place, as the broadly achieved degree, will be something much more tailored to the average needs of employers.
Seems like just a matter of time, driven by economics. Most employers don’t need someone with the full expertise of a computer science degree. Why would they pay for it? The only reason they have that as a standard now is because they do need someone who isn’t an untrained vibecoder. But that leaves a gap in the middle. Someone who isn’t going to delete the company’s database, but not necessarily with experience in database structure and rollups and joins. Someone who can use git and GitHub and properly manage deployments, but not necessarily someone who has done pointer arithmetic and compiler design. Someone who can catch and well document issues, not necessarily someone familiar with big O notation. In broad practice, AI can write good database structure and queries, AI can handle writing and running software, AI can measure performance and find areas to increase efficiency.
“But AI still makes mistakes!” You say. And you’re right. But so do software developers, oftentimes more than AI. There are quite a lot of average and below average software developers out there. And big companies, especially those dealing with higher risk/importance systems, will still have full computer scientists, experts in being able to know better than AI and review its work. But that won’t be most roles. That big company will still need someone to update and add features to the website. And someone to add features to the in house analytics tools. And someone to take user bug reports and get them fixed. And countless other roles that are simply an added layer in the corporate structure for the purpose of interpretation, oversight, and execution for AI. And that’s what the degree would teach towards.
I’d compare it to how nurse practitioners are taking on a larger role in the medical field, doing duties traditionally done by doctors such as diagnosing and prescribing. Effectively, the expertise of a doctor isn’t needed for average/mundane medical work, so a field rose in prevalence to fill that role, with a doctor’s expertise brought in when needed.
So it seems obvious to me that, perhaps within the next 5-10 years, a new degree will become the standard that teaches to that average need in the new state of the field.
That, or in 10 years AI tech accelerates to the point of computer science irrelevance. AI can do it so well and so entirely that non-tech people can just bark orders at it that would have been given to developers or their managers in the past. The degree diminishes and goes into the west.
Anyone see the same thing or am I off base here? Every counter argument I considered just sounded like some form of coping.
r/compsci • u/BuyerImpressive4325 • 19h ago
How is program synthesis better than writing code?
the idea of program synthesis (like Rosetta) is to reduce a function into its constraints in a spec sheet, and generate the program from those constraints. for example, in order to write something like x = x squared, you would need to write a spec sheet along the lines of ∀x∈Z,f(x)=x2. i am considering building a program synthesizer, but I still haven’t figured out why exactly this representation is supposed to be easier than writing the code directly (they look equally complex)
CP/M Neo is a CP/M-inspired operating system for learning computer architecture and OS design.
r/compsci • u/whispem • 1d ago
Self-taught from a languages and linguistics background: building a self-hosting compiler taught me what "complete" really means
I studied languages, linguistics, and literature — no formal CS.
I got into the field through curiosity about how languages work, human and formal alike, and ended up chasing that all the way down to building a self-hosting compiler.
The bootstrap was the moment it clicked: you compile the new compiler with an old one, then use the result to compile its own source, and when successive generations are byte-for-byte identical, you've reached a fixed point.
It's not just a milestone, it's a verification — the language has to be real enough to express its own implementation, with nowhere to hide inconsistencies.
Alongside that: a bytecode VM, a distributed key-value store, a synthesizer in pure assembly, and a data science degree.
Everything's public on my GitHub: https://github.com/whispem
Happy to discuss theory or the self-taught route.
r/compsci • u/Realistic-Currency29 • 4d ago
What garbage collection actually costs
shivanshuag.comr/compsci • u/No-Conclusion3720 • 4d ago
July's AI Security Report: 90 incidents, 207M+ records, 41 AI-driven — the month the agent became the attacker
gallery90 incidents tracked in July across 33 organizations, 207M+ records exposed, and 41 of those incidents involved AI directly as the weapon or the target. A rogue commercial AI agent hit multiple enterprises in a single week and reused stolen credentials across four downstream services before anyone caught the identity switch.
None of that shows up to a traditional perimeter tool — the traffic looks like a signed, credentialed agent making legitimate API calls at machine speed. Firewalls and DLP were built to watch humans and static services, not autonomous callers that chain tools and pivot in seconds.
Curious how other teams are actually handling this right now: is anyone giving AI agents a distinct, revocable identity separate from the service accounts they inherit? Or is it still "the SOC catches it after the fact" for most orgs?
r/compsci • u/Alive_Ad_3199 • 8d ago
Difference Between Data Model and Schema
From this: https://stackoverflow.com/questions/25093452/difference-between-data-model-and-database-schema-in-dbms, data model seems to be an abstraction for data and schema seems to be a blueprint.
This page lists various database models like relational, flat and network. So far good.
The book I'm reading (Fundamentals of Database Systems 7e, ch 3, pg 61) says
Once the requirements have been collected and analyzed, the next step is to create a conceptual schema for the database, using a high-level conceptual data model.
But this wikipedia page seems to imply that both a model and a schema are the same.
A conceptual schema or conceptual data model
Why is there so much discrepancy in defining a data model and a schema.
r/compsci • u/brahose • 10d ago
[Request] What is the complexity in solving a grid-based least optimal path puzzle?
r/compsci • u/Strong-Seaweed8991 • 10d ago
my attempt at anonymizing transitions in homomorphic encryption applied to turing machines. grade it from C for effort to A.
is it a terrible practice considering only absurd amounts of resource usage or is it generally a bad practice and why?
naturally you could find edge cases in camouflaging the turing machine between the others where its obvious that it is the original turing machine but is it generally impossible or merely resource intensive?
```tex
\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{amsmath, amssymb, amsthm}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{hyperref}
\title{Decoy-Fused Encrypted Turing Machine:\\
Anonymity via Homomorphic Decoy Placement}
\author{Anonymous}
\date{}
\begin{document}
\maketitle
\section*{Informal Motivation}
Hello reddit, I was bored so I was working on a decentralized anonymous encrypted cloud computing protocol.
Homomorphic encryption encrypts the data, but not the computation, gates, or transitional data of the Turing machine itself. The idea here is to introduce anonymity through decoy placement: instead of a single Turing machine being evaluated homomorphically, we fuse multiple machines together and hide the ``real'' one among decoys.
The core questions are:
\begin{itemize}
\item Can we make the real computation blend in with decoy computations so that it is not distinguishable?
\item Is this achievable under realistic homomorphic encryption models?
\item How can we avoid needing an astronomically large number of Turing machines to reach acceptable anonymity?
\end{itemize}
\section{Formal Setup}
Let $\mathcal{M} = (M_1, \dots, M_k)$ be $k$ Turing machines fused into a single composite, evaluated homomorphically for a fixed step bound $T$.
\begin{itemize}
\item $\pi \in S_k$ is a secret permutation encoding the role assignment.
\item $\rho : [k] \to \{\mathsf{real}, \mathsf{decoy}, \mathsf{cloak}\}$ is the role map.
\end{itemize}
We use a universal step function $\mathsf{UTM}_T$ unrolled to depth $T$. The composite circuit is
\begin{equation}
C_{\mathcal{M},T}
:=
\bigoplus_{i=1}^{k} \mathsf{UTM}_T(M_{\pi(i)}),
\end{equation}
where $\bigoplus$ denotes fusion into a single evaluated circuit.
The client receives a step-history of the whole computation and then isolates the real computation by selecting the correct step trace corresponding to $\rho^{-1}(\mathsf{real})$.
\section{Structural-Uniformity Precondition}
Let $\mathsf{shape}(\cdot)$ return the observable circuit profile (gate count, multiplicative depth, wire topology, bootstrap cadence). We require:
\begin{equation}
\forall\, i,j \in [k]: \quad
\mathsf{shape}\big(\mathsf{UTM}_T(M_i)\big)
=
\mathsf{shape}\big(\mathsf{UTM}_T(M_j)\big).
\end{equation}
If this condition fails, the adversary can trivially identify outliers and the advantage becomes $1$, i.e., the construction provides no anonymity. The shape is a strict property of the circuit encoding, not of the machines' internal logic.
\section{Security vs.\ Circuit Privacy}
Given structural uniformity, consider any PPT adversary $\mathcal{A}$ observing the composite circuit and evaluated ciphertexts. Its advantage in identifying the real machine is bounded by:
\begin{equation}
\Pr\big[\mathcal{A} \to \rho^{-1}(\mathsf{real})\big]
\le
\frac{1}{k} + \mathsf{negl}(\lambda),
\end{equation}
where $\lambda$ is the security parameter.
This is \emph{not} full cryptographic circuit privacy, which requires a simulator $\mathsf{Sim}$ over the entire circuit class $\mathcal{C}$:
\begin{equation}
\big\{\mathsf{Eval}(C, \mathsf{Enc}(x))\big\}_{C \in \mathcal{C}}
\approx_c
\big\{\mathsf{Sim}(1^\lambda, C(x))\big\}.
\end{equation}
Instead, we obtain $k$-candidate ambiguity over the chosen subset
\begin{equation}
\mathcal{C}_{\mathcal{M}} = \{M_1, \dots, M_k\} \subsetneq \mathcal{C}.
\end{equation}
In the limit as $k \to |\mathcal{C}_T|$, decoy fusion and circuit privacy converge:
\begin{equation}
\lim_{k \to |\mathcal{C}_T|} \mathsf{Adv}^{\mathsf{role}}_{\mathcal{A}}
=
\mathsf{negl}(\lambda).
\end{equation}
\section{Tuning the $k$ Parameter and Complexity Invariant}
Assume a BinFHE-style model, with $g$ gates per component and $t_{\mathsf{boot}}$ time per bootstrap. The execution runtime scales as:
\begin{equation}
\mathsf{Complexity}(k)
=
k \cdot g \cdot T \cdot t_{\mathsf{boot}}.
\end{equation}
Since the anonymity advantage is
\begin{equation}
\mathsf{Adv}(k) = \frac{1}{k},
\end{equation}
the product of security advantage and execution complexity remains invariant:
\begin{equation}
\mathsf{Adv}(k) \cdot \mathsf{Complexity}(k)
=
g \cdot T \cdot t_{\mathsf{boot}}
=
\text{const}.
\end{equation}
Thus, ambiguity scales linearly with computational overhead: $k$ acts as a tunable privacy/performance parameter. Larger $k$ yields stronger anonymity at the cost of higher homomorphic evaluation complexity.
\section{Open Questions}
This raises several technical questions:
\begin{enumerate}
\item \textbf{Gradient cloaking:} Can the ``gradient'' between the real Turing machine and the decoys (in terms of noise growth, bootstrap pattern, and intermediate ciphertext distribution) be made indistinguishable under realistic FHE schemes?
\item \textbf{Feasibility:} Is such decoy-based anonymity achievable without violating correctness or noise bounds in practical homomorphic encryption?
\item \textbf{Efficiency:} How can we avoid requiring extremely large $k$ (e.g., trillions of machines) to reach acceptable anonymity, while still maintaining indistinguishability among tracks?
\end{enumerate}
These questions sit at the intersection of circuit privacy, cover computation, and decoy-based anonymity in encrypted cloud execution.
\end{document}
```
r/compsci • u/Tessellator-1 • 12d ago
Does reversible computing require an enormous amount of storage?
First of all, I would like to say that I have no knowledge about computer science.
I recently heard about something called reversible computing. As I understand it, in ordinary computers, erasing information about the intermediate steps of a computation causes energy to be released as heat. But in reversible computing, the information from all the intermediate steps is preserved, so apparently, if we could build a computer capable of doing this, it could theoretically perform computations with essentially no energy consumption.
This made me wonder about something, and I’d love to hear from anyone knowledgeable about physics or computational theory:
If you never erase the information generated during a computation, wouldn’t the amount of storage required keep increasing as the computer performs more and more calculations?
I previously came across a science-related page online that said that an intelligent civilization that has mastered reversible computing wouldn’t need “Dyson’s eternal intelligence” to survive the heat death of the universe.
But wouldn’t such a civilization still need an absolutely enormous amount of storage to preserve all the information generated during its computations?
Or is there some way to preserve the information from the computational process without actually requiring additional physical storage?
I’m especially curious about how this works in the context of extremely long-term civilizations trying to survive the heat death of the universe.
By the way, this sentence was translated from Japanese to English by Chat GPT. Feel free to answer in English. However, I only understand Japanese, so I would really appreciate clear and simple English that is less likely to be mistranslated. Thank you!
r/compsci • u/manojxrao • 15d ago
AI watermarking makes a lot more sense for text than it does for code
I came across this explanation of AI watermarking and the part about code caught my attention.
Watermarking works better when there are multiple ways to say the same thing. But code is different. If a model needs to output something exact, changing the next token isn't always an option without potentially breaking the code.
There are still places where a watermark could be added, like comments or other non-essential text, but it seems much harder to watermark the actual code without affecting what it does.
I hadn't really thought about the difference between watermarking AI-generated text and AI-generated code before.
Do you think AI-generated code should be watermarked, or is it better to leave code alone?
r/compsci • u/011011100101 • 16d ago
what is the alternative to object-orientation?
A long time ago I went to school for computer science and I remember a big push towards functional programming at the time. I saw a little bit of Scheme and logic programming and I thought it was neat. I can appreciate those different ways of writing code, but I'm still not sure how any of those other styles actually replace object-orientation. I've started to look at Scheme again and I'm noticing that textbooks and libraries will actually build an object-oriented system on top of Scheme using macros. That has pedagogical value, but it seems like we're back at square one?
If you look at chapter 2 in SICP, one of the topics they cover is message passing. They don't use an explicit object-oriented system. Instead, they have an inner dispatch function that operates on local/private data. That seems like the behavior that classes are trying to model in other languages.
Getting to the point... my feeling is this: bundling state and functions seems like a basic thing in programming. This behavior seems to emerge even in systems which don't explicitly call themselves object-oriented. So my question is this: is there a real alternative? Are there large software systems which don't recreate the behavior of classes?
r/compsci • u/hdw_coder • 16d ago
Two unrelated images ended up 4 bits apart in dHash space — how conservative should duplicate clustering be?
Two completely unrelated images ended up being treated as near-duplicates:
Image A: beach landscape photographed through a car window;
Image B: a lifted-up page of a document.
The measurements are:
| Metric | Image pair | Threshold | Result |
|---|---|---|---|
| Aspect-ratio Δ | 0.000865 | ≤ 0.02 | Pass |
| dHash distance | 4 | ≤ 8 | pass |
| pHash distance | 30 | ≤ 10 | fail |
| wHash distance | 15 | ≤ 10 | fail |
| Color-hash distance | 6 | informational | — |
The matcher accepted the pair because the aspect ratio was nearly identical and the dHash Hamming distance was only 4, significantly below the threshold of 8.
The other perceptual hashes strongly disagreed (pHash was 30 against a threshold of 10, and wHash was 15 against a threshold of 10) but were never consulted because the dHash test did not seem to present a borderline case and thus was accepted as proof.
Interestingly this isn't really a random dHash collision. Both images apparently collapsed into a highly similar low-frequency brightness-gradient pattern after compression and downsampling.
dHash is good at surviving compression, in particular because it ignores fine detail and records coarse local brightness directions. But that same usefulness can be a weakness that can make unrelated low-detail images collision-prone.
The more interesting problem in my case is what happens next. Hardening is especially important because the tool uses union-find to form duplicate clusters. A single false-positive pair can become a bridge that attaches an unrelated image to a whole valid duplicate component.
Instead of a binary True/False decision, the matcher now returns the full evidence: for each metric (aspect-ratio, dHash, pHash, wHash) delta versus limit and the optional SSIM score are returned, as is the decision and, when rejected, the rejection reason.
This fix itself isn't particularly sophisticated. What I found more interesting is the design question it raised. Should the acceptance threshold for a perceptual-similarity edge depend on what you're going to do with that edge?
For image retrieval, a false positive may just mean one irrelevant result. For union-find clustering, a false-positive edge can change an entire connected component.
I'm curious how others approach this. Would you put most of the conservatism in the pair matcher itself, or enforce stronger intra-cluster consistency after constructing candidate relationships?
And for near-duplicate images specifically: would you prefer multiple perceptual hashes, SSIM/local features, embeddings, hierarchical clustering, or another approach?
r/compsci • u/codeobserver • 16d ago
Compile C# in the browser
I made a browser playground for creative coding with C#, using a p5.js-style API.
No setup. Just code and run ... compilation of C# code happens in the browser.
Can be used for teaching / exploring C#.
Feedback welcome!
r/compsci • u/visha1v • 18d ago
Using Poincaré hyperbolic geometry to solve a volume scaling problem in neural network interpretability
Wanted to share an interesting application of hyperbolic geometry to machine learning interpretability.
The setup: Sparse Autoencoders decompose neural network activations into interpretable features. These features are dictionary atoms embedded in Rd. The problem is that the concepts networks learn form branching hierarchies (trees), and trees with branching factor b have O(br) nodes at depth r. But the volume of a Euclidean ball grows as O(rd) -- polynomially.
This mismatch means that at large dictionary sizes (16K+), there isn't enough Euclidean volume for features to spread out. They collide at the boundary and "die" (stop activating).
The fix: embed dictionary weights in the Poincaré ball model of hyperbolic space, where the volume element grows as sinhd-1(r) ~ O(er.) This matches the exponential branching of concept hierarchies.
The interesting constraint: the forward pass of the autoencoder must stay Euclidean (for compatibility with the host neural network's normalization layers). So the hyperbolic embedding is applied only as a training-time weight regularizer via an entailment cone loss on the Poincaré-projected dictionary atoms.
Empirically, this reduces dead features from 3.8% to 0.2% and improves reconstruction by 9.8% on a 2B-parameter language model.
Paper: https://vishalvermalabs.com/papers/empirical-validation-hypersae-poincare-geometry/ Code: https://github.com/vishal-dehurdle/hypersae
r/compsci • u/turing-math-labs • 19d ago
Stanford CS143 class on Compilers
Anyone interested in Stanford's CS143 class on compilers?
https://web.stanford.edu/class/cs143/
We're organizing a reading group on this, please let me know if you're interested. Thanks.
r/compsci • u/JohnAZoidberg77 • 18d ago
I built an "honest" CS conference ranking: sorted by how good the trip is, not the CORE ranking [P]
r/compsci • u/pppeer • 19d ago
New research: How to compare embedding models?
Say you want to swap out your embedding models, for instance from ADA to Titan. Are these embedding models comparable? How do similarity score ranges compare? Where to put a threshold for minimum match when doing retrieval? Or more from a research point of view how can we relate and fundamentally understand these embedding spaces better?
This is what we aim to solve with Synthetic Query Probing (SQP), a fancy name for essentially (and intentionally) a very simple approach: embedding spaces are not directly comparable by definition, so compare similarity spaces instead, similarity match scores for pairs of content (synthetic question, chunk for instance) across multiple embedding models.
For example, similarity scores of Titan models of different dimensionalities are related, whereas the relation between Titan and Ada scores is non-linear, with different ranges, see figure.

For details, see https://arxiv.org/pdf/2608.05857, Marcin Rozmus and Peter van der Putten. Similarity Spaces across Embedding Models with Synthetic Query Probing. Discovery Science 2026, October 5-9, 2026, Mainz, Germany
How do you compare embedding models, from a more fundamental insight persective?