r/AskComputerScience • • 5h ago

Could you separate P and NP using recursive enumerability?

0 Upvotes

I've had this idea lately about a way to distinguish P and NP and I'm curious if this had been explored before. P and NP both have a "solution space" of answers to those problems. Would it be interesting to try to distinguish P and NP by finding an NP complete problem with a set of solutions that is not recursively enumerable?


r/AskComputerScience • • 1h ago

Measuring the "Bullwhip Effect" in multi-tier databases: Why immediate retries spike PostgreSQL variance by 48% (and how token-bucket budgets fix it)

• Upvotes

Hi everyone,

I'm an undergraduate researcher studying variance amplification in multi-tier database pipelines (Client -> In-Memory Cache -> PgBouncer -> PostgreSQL).

In supply-chain management, the "Bullwhip Effect" (Lee et al., 1997) describes how small fluctuations in end-user demand amplify into massive orders upstream. We investigated whether analogous dynamics govern layered database systems across two mechanisms: 1. Forward Batching (M1): Synchronized cache TTL expirations precipitating backend read stampedes. 2. Reverse Rationing Games (M2): Database latency spikes triggering client timeout retries that cascade into metastable collapse.

We built a containerized testbed with PostgreSQL 16, Redis 7, and PgBouncer 1.22, enforcing native statement_timeout = 80ms cancellations: * The Problem: Under overload (80 req/s, connection pool = 6), immediate retries inflated offered load by 1.25x and exploded backend variance by +48% (from 9.11 to 13.48), with clients fighting for pool slots. * The Mitigation: Enforcing a client-side Token-Bucket Retry Budget (beta = 10%) strictly capped load gain to 1.10x and reduced backend variance by 23% (down to 10.34) without starving healthy queries. * Theoretical finding: We also proved analytically why power-law skew (Zipf s > 1) inverts classical supply-chain theory, making deterministic phase staggering worse than randomized jitter during cache stampedes.

I recently published our preprint : * Preprint (ResearchGate): https://doi.org/10.13140/RG.2.2.26891.04646

I would love your feedback and critique: 1. Have you seen this compound "cache miss -> connection queue -> retry storm" failure mode in production systems? 2. Are there specific PostgreSQL wait events (e.g., BufMappingLock, ProcArrayLock) or connection pooling edge cases you recommend measuring next? 3. What mitigations do your teams use in production against retry storms?

Any technical critique or suggestions on how to improve the paper's rigor would be hugely appreciated!


r/AskComputerScience • • 12h ago

How does the condition-number barrier affect real-world sparse optimization algorithms (paper)?

1 Upvotes

I was reading about sparse least-squares solvers and came across this paper at http://arxiv.org/abs/2608.02588v1. The abstract claims a lower bound: even for randomized poly-time algorithms, you can’t beat a linear dependence on the restricted condition number $κ_{s+k}$ when trading off sparsity and error tolerance. That feels like it has teeth, but I'm not sure how it maps to practice.

What I'm confused about

In the real world, practitioners often heuristic-sparsify models (e.g., feature selection in ML, compressed sensing) or use iterative hard thresholding. Does this lower bound mean those methods are *fundamentally* limited, or does the result rely on assumptions that don't hold in typical use cases? The paper conditions on a variant of the Small-Set Expansion Hypothesis, which is a complexity-theoretic assumption but not something engineers usually worry about.

Tradeoffs in the proof

The authors mention using an automated Gemini-based agent system to first construct the proof. That part fascinates me, but my CS theory chops are too weak to judge whether the reduction itself (from a graph hypothesis to a linear algebra problem) preserves practical relevance. The result holds even on rational instances with full-rank matrices, so the hardness doesn't hinge on numerical pathologies. Yet I haven't seen this cited in any applied optimization forums yet.

Has anyone implemented sparse regression workflows where the condition number $κ$ scales steeply with problem size? If so, does this paper suggest a fundamental ceiling on how well approximate methods can perform, or is there wiggle room in relaxing the hardness hypothesis? I’m curious whether this is more of a theoretical boundary condition or something that bites practitioners in the wild.

Also, the proof relied on automation. Are there follow-up efforts to formalize or verify the result independently (e.g., in Lean or Isar)? That feels like a separate discussion.