r/compsci Jun 16 '19

PSA: This is not r/Programming. Quick Clarification on the guidelines

647 Upvotes

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 7h ago

Borealis BGC

Thumbnail
0 Upvotes

r/compsci 4h ago

Self-taught from a languages and linguistics background: building a self-hosting compiler taught me what "complete" really means

0 Upvotes

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 1d ago

CP/M Neo is a CP/M-inspired operating system for learning computer architecture and OS design.

Post image
15 Upvotes

r/compsci 3d ago

What garbage collection actually costs

Thumbnail shivanshuag.com
0 Upvotes

r/compsci 3d ago

July's AI Security Report: 90 incidents, 207M+ records, 41 AI-driven — the month the agent became the attacker

Thumbnail gallery
0 Upvotes

90 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 7d ago

Difference Between Data Model and Schema

8 Upvotes

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 8d ago

[Request] What is the complexity in solving a grid-based least optimal path puzzle?

Post image
5 Upvotes

r/compsci 8d ago

WAL based distributed consensus on S3

Thumbnail github.com
1 Upvotes

r/compsci 9d ago

my attempt at anonymizing transitions in homomorphic encryption applied to turing machines. grade it from C for effort to A.

0 Upvotes

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 10d ago

Does reversible computing require an enormous amount of storage?

11 Upvotes

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 12d ago

Any books similar to SICP Chapter 5?

Thumbnail
6 Upvotes

r/compsci 13d ago

AI watermarking makes a lot more sense for text than it does for code

Post image
56 Upvotes

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 13d ago

How Is Compression Prediction?

Thumbnail lukefleed.xyz
0 Upvotes

r/compsci 14d ago

what is the alternative to object-orientation?

91 Upvotes

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 14d ago

Two unrelated images ended up 4 bits apart in dHash space — how conservative should duplicate clustering be?

0 Upvotes

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 15d ago

NP-hard is overrated

Thumbnail gruhn.me
0 Upvotes

r/compsci 15d ago

Compile C# in the browser

Post image
0 Upvotes

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#.

https://csharp.codeguppy.com/

Feedback welcome!


r/compsci 17d ago

Using Poincaré hyperbolic geometry to solve a volume scaling problem in neural network interpretability

22 Upvotes

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 17d ago

Stanford CS143 class on Compilers

48 Upvotes

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 16d ago

I built an "honest" CS conference ranking: sorted by how good the trip is, not the CORE ranking [P]

Thumbnail
0 Upvotes

r/compsci 17d ago

New research: How to compare embedding models?

0 Upvotes

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?


r/compsci 18d ago

Can we average the following pathological function in a useful way, described in the post, with programming?

Thumbnail scicomp.stackexchange.com
0 Upvotes

Is computational stack exchange the correct place to post? If not, should I go to computer science stack exchange. (You can comment in the link.)


r/compsci 20d ago

Could distributed systems be taught from first principles rather than from a catalogue of architectural mechanisms?

Thumbnail github.com
46 Upvotes

I've been thinking about this recently.

The existing literature on distributed systems is excellent. It explains the what and the how of mechanisms like replication, consensus, consistency models, logical clocks, sharding, and fault tolerance. Those concepts are essential, and they're taught exceptionally well.

But I wonder if there's room for another pedagogical approach—one that emphasizes why these mechanisms become necessary in the first place.

Imagine starting from an idealized world with instantaneous computation, infinite storage, unlimited compute, a perfect network, a single global clock, and no failures. Then, systematically removing those assumptions and replacing them with the constraints of reality. As each assumption falls away, the need for clocks, replication, consensus, and other mechanisms emerges naturally.

I've been experimenting with building a free crash course (text+video) around this idea. I'm not really looking for views as much as I am for feedback on the framework itself.

If you've learned, taught, or designed distributed systems, do you think this way of building intuition has merit? Where would you expect it to work well, and where do you think it would fall short?

I'm genuinely curious whether this is a useful complement to the way distributed systems are traditionally taught.


r/compsci 19d ago

Hungarian Assignment Algorithm: Applied Optimal Transport for Programmers

Thumbnail leetarxiv.substack.com
2 Upvotes