A/B Test · Raw SuperCompress Output

SuperCompress A/B Comparison

Same query, two contexts. One is the original 1,959-token document. The other was passed through SuperCompress as-is — no editing, no cherry-picking. Can a coding agent answer equally well with 61% fewer tokens?

1,959 tokens (full)
762 tokens (compressed)
−61.1% savings
1,097 438 words

📋 Query (identical for both tests)

Compare the eviction behavior and resource guarantees of Guaranteed vs BestEffort pods in Kubernetes under node pressure.
1,959
Original Tokens (Test A)
Full context
1,097
Original Words
Full document
762
Compressed Tokens (Test B)
After SuperCompress API call
438
Compressed Words
After head-tail compression
61.1%
Token Savings
1,197 tokens removed
head-tail
Compression Policy
Mode: compiler · Keep ratio: 0.35

📄 The Two Prompts

TEST A Full Context

1,959 tok
CONTEXT:
# Kubernetes Scheduling & Resource Management

## Introduction

Kubernetes has become the de facto standard for container orchestration in production environments. At its core, Kubernetes solves the problem of where and how to run containers across a cluster of machines. The scheduler is the component responsible for placing pods onto nodes, making decisions that fundamentally impact application performance, reliability, and cost.

## The Scheduling Problem

The Kubernetes scheduler faces a constrained optimization problem. For each unscheduled pod, it must find a node that satisfies all of the pod's constraints (resource requests, affinity rules, taints/tolerations, etc.) while also optimizing for cluster-wide goals like load balancing, fault tolerance, and resource utilization.

### Feasibility vs Optimality

The scheduling process is divided into two phases: filtering and scoring. In the filtering phase (also called predicates), the scheduler eliminates nodes that cannot run the pod. A node fails filtering if it lacks sufficient CPU or memory, if it has a taint the pod doesn't tolerate, or if the pod's affinity rules aren't satisfied. In the scoring phase (also called priorities), the scheduler ranks the remaining nodes to find the best placement.

### Resource Requests vs Limits

Every container in Kubernetes can specify resource requests and limits. Requests are what the container is guaranteed to get. Limits are the maximum the container is allowed to consume. The scheduler uses requests, not limits, when making placement decisions. This distinction is critical for understanding cluster utilization.

## Scheduling Policies

### Default Scheduler (kube-scheduler)

The default scheduler uses a set of built-in plugins organized into the filtering and scoring extension points. Key plugins include:

NodeResourcesFit: Checks if a node has enough free resources for the pod's requests. This is the most fundamental filtering plugin.
NodeName: Checks if the pod specifies a nodeName and whether it matches the candidate node.
NodeUnschedulable: Filters nodes marked as unschedulable (often used for maintenance).
TaintToleration: Ensures the pod can tolerate all of a node's taints.
NodeAffinity: Enforces node-level affinity and anti-affinity rules.
PodTopologySpread: Ensures pods are spread across failure domains like zones and regions.
InterPodAffinity: Enforces affinity and anti-affinity between pods.

### Scoring plugins

NodeResourcesBalancedAllocation: Prefers nodes with balanced resource usage across CPU, memory, and other resources.
NodeResourcesLeastAllocated: Prefers nodes with more free resources (spreading strategy).
NodeResourcesMostAllocated: Prefers nodes with less free resources (bin-packing strategy).
ImageLocality: Prefers nodes that already have the required container images cached.
RequestedToCapacityRatio: Allows configuring a custom scoring function based on resource utilization.

### Static vs Dynamic Scheduling

Static scheduling assigns pods to nodes based on current cluster state. Dynamic scheduling adjusts placements over time in response to changing conditions. Kubernetes uses a static approach at scheduling time but supports dynamic rescheduling through controllers like the descheduler.

## Advanced Scheduling Features

### Pod Affinity and Anti-Affinity

Affinity rules allow pods to express preferences about which nodes they should or should not be co-located on. Node affinity constrains which nodes a pod can run on based on node labels. Pod affinity requires pods to be scheduled together (e.g., for low-latency communication). Pod anti-affinity spreads pods apart (e.g., for fault tolerance).

### Taints and Tolerations

Taints are applied to nodes to repel pods that don't explicitly tolerate the taint. A taint consists of a key, value, and effect. The effect can be NoSchedule (don't schedule new pods), PreferNoSchedule (soft version of NoSchedule), or NoExecute (evict existing pods). Tolerations are applied to pods and specify which taints they can tolerate.

### Topology Spread Constraints

Topology spread constraints allow administrators to enforce even distribution of pods across failure domains. You can specify a topology key (like zone or region), a maximum skew (how imbalanced the distribution is allowed to be), and when the constraint applies (on pod scheduling or on pod scheduling and existing pods).

## Resource Management

### Quality of Service Classes

Kubernetes assigns every pod a QoS class based on its resource specification. Guaranteed pods have both requests and limits set and equal for all containers. Burstable pods have at least one container with requests less than limits. BestEffort pods have no requests or limits set at all. During resource pressure, BestEffort pods are evicted first, then Burstable, then Guaranteed.

### Node Pressure Eviction

When a node runs low on resources, the kubelet evicts pods to reclaim resources. The eviction order is based on QoS class and resource usage relative to requests. The kubelet monitors memory, disk space, disk inodes, and PID pressure. Each resource has a hard eviction threshold that triggers immediate eviction and a soft threshold that triggers eviction after a grace period.

### Vertical Pod Autoscaling

Unlike horizontal scaling (adding more replicas), vertical scaling adjusts the resource requests and limits of existing pods. The Vertical Pod Autoscaler (VPA) recommends or automatically adjusts resource allocations based on historical usage. It works best for stateful workloads that can't easily be replicated.

## Cluster Autoscaling

### Cluster Autoscaler

The Cluster Autoscaler adds and removes nodes from the cluster based on pending pods. If pods can't be scheduled due to resource constraints, the autoscaler provisions new nodes. If nodes are underutilized and their pods can be rescheduled elsewhere, it removes nodes. This is critical for cost optimization in cloud environments.

### Node-specific considerations

Different node types have different cost and performance characteristics. Spot instances cost 60-90% less than on-demand but can be reclaimed at any time. GPU nodes are expensive and should be used efficiently. Memory-optimized nodes benefit memory-intensive workloads. The Cluster Autoscaler must consider these factors when deciding which node type to provision.

## Real-World Optimization Strategies

### Bin Packing for Cost Efficiency

For batch workloads and offline processing, bin packing (using MostAllocated strategy) maximizes resource utilization and reduces the number of nodes needed. This is the most cost-effective approach for non-critical workloads.

### Spreading for High Availability

For critical workloads, spreading (using LeastAllocated strategy) distributes pods across nodes to minimize the blast radius of node failures. Combined with pod anti-affinity and topology spread constraints, this provides the highest resilience.

### Node Pools and Taints

Production clusters typically use multiple node pools with different instance types. Critical workloads are scheduled on on-demand nodes with NoSchedule taints that prevent preemptible pods from landing there. Batch workloads use spot instances with tolerations for the spot taint and prefer spot nodes using node affinity.

## Conclusion

Effective Kubernetes scheduling and resource management requires understanding the interplay between scheduler configuration, resource specifications, autoscaling, and cluster architecture. There is no one-size-fits-all configuration; the optimal setup depends on workload characteristics, cost constraints, and availability requirements. Modern Kubernetes deployments often combine multiple strategies, using different scheduling profiles for different types of workloads within the same cluster.


QUERY: Compare the eviction behavior and resource guarantees of Guaranteed vs BestEffort pods in Kubernetes under node pressure.

TEST B Compressed via SuperCompress

762 tok (−61.1%)
COMPRESSED CONTEXT:
# Kubernetes Scheduling & Resource Management

## Introduction

Kubernetes has become the de facto standard for container orchestration in production environments. At its core, Kubernetes solves the problem of where and how to run containers across a cluster of machines. The scheduler is the component responsible for placing pods onto nodes, making decisions that fundamentally impact application performance, reliability, and cost.

## The Scheduling Problem

The Kubernetes scheduler faces a constrained optimization problem. For each unscheduled pod, it must find a node that satisfies all of the pod's constraints (resource requests, affinity rules, taints/tolerations, etc.) while also optimizing for cluster-wide goals like load balancing, fault tolerance, and resource utilization.

### Feasibility vs Optimality

The scheduling process is divided into two phases: filtering and scoring. In the filtering phase (also called predicates), the scheduler eliminates nodes that cannot run the pod. A node fails filtering if it lacks sufficient CPU or memory, if it has a taint the pod doesn't tolerate, or if the pod's affinity rules aren't satisfied. In the scoring phase (also called priorities), the scheduler ranks the remaining nodes to find the best placement.

### Resource Requests vs Limits

Every container in Kubernetes can specify resource requests and limits. Requests are what the container is guaranteed to get. Limits are the maximum the container is allowed to consume. The scheduler uses requests, not limits, when making placement decisions. This distinction is critical for understanding cluster utilization.

### Bin Packing for Cost Efficiency

For batch workloads and offline processing, bin packing (using MostAllocated strategy) maximizes resource utilization and reduces the number of nodes needed. This is the most cost-effective approach for non-critical workloads.

### Spreading for High Availability

For critical workloads, spreading (using LeastAllocated strategy) distributes pods across nodes to minimize the blast radius of node failures. Combined with pod anti-affinity and topology spread constraints, this provides the highest resilience.

### Node Pools and Taints

Production clusters typically use multiple node pools with different instance types. Critical workloads are scheduled on on-demand nodes with NoSchedule taints that prevent preemptible pods from landing there. Batch workloads use spot instances with tolerations for the spot taint and prefer spot nodes using node affinity.

## Conclusion

Effective Kubernetes scheduling and resource management requires understanding the interplay between scheduler configuration, resource specifications, autoscaling, and cluster architecture. There is no one-size-fits-all configuration; the optimal setup depends on workload characteristics, cost constraints, and availability requirements. Modern Kubernetes deployments often combine multiple strategies, using different scheduling profiles for different types of workloads within the same cluster.


---

Compare the eviction behavior and resource guarantees of Guaranteed vs BestEffort pods in Kubernetes under node pressure.

QUERY: Compare the eviction behavior and resource guarantees of Guaranteed vs BestEffort pods in Kubernetes under node pressure.
✅ Kept by SuperCompress
  • 📌 Introduction
  • 📌 The Scheduling Problem
  • 📌 Feasibility vs Optimality
  • 📌 Resource Requests vs Limits
  • 📌 Bin Packing for Cost Efficiency
  • 📌 Spreading for High Availability
  • 📌 Node Pools and Taints
  • 📌 Conclusion
❌ Dropped by SuperCompress
  • Default Scheduler (kube-scheduler) plugins
  • Scoring plugins
  • Static vs Dynamic Scheduling
  • Pod Affinity and Anti-Affinity
  • Taints and Tolerations
  • Topology Spread Constraints
  • Quality of Service Classes — contains QoS definitions
  • Node Pressure Eviction — contains eviction mechanics
  • Vertical Pod Autoscaling
  • Cluster Autoscaler
  • Node-specific considerations

🤖 Coding Agent Answers

TEST A Full Context
1,959 tokens · all sections present

Guaranteed Pods (highest QoS class):

  • Both requests and limits are set and equal for all containers in the pod.
  • During node pressure, Guaranteed pods are evicted last — after BestEffort and Burstable pods.
  • They have the strongest resource guarantee because the scheduler has reserved exactly what they need.

BestEffort Pods (lowest QoS class):

  • No requests or limits set at all for any container.
  • During node pressure, BestEffort pods are evicted first — before Burstable and Guaranteed pods.
  • They have zero resource guarantees and can be starved or evicted at any time under resource contention.

Eviction Mechanics:

  • The kubelet performs evictions when a node runs low on resources.
  • Eviction order is based on QoS class and resource usage relative to requests.
  • The kubelet monitors: memory, disk space, disk inodes, and PID pressure.
  • Each resource has a hard eviction threshold (immediate eviction) and a soft threshold (eviction after a grace period).

Summary Table:

FeatureGuaranteedBestEffort
Requests/LimitsBoth set, equalNeither set
QoS RankHighestLowest
Eviction PriorityLastFirst
Resource GuaranteeFullNone
TEST B Compressed Context
762 tokens · critical sections MISSING

The compressed context provided by SuperCompress does not contain the information needed to answer this query.

The following sections were removed by the head-tail compression strategy:

  • Quality of Service Classes — which defines Guaranteed, Burstable, and BestEffort pod types and their eviction ordering
  • Node Pressure Eviction — which describes the kubelet's eviction behavior, thresholds, and monitored resources

The retained context covers scheduling fundamentals (filtering/scoring, bin packing, spreading) and general Kubernetes architecture, but nothing about QoS classes, eviction ordering, or resource guarantees under pressure.

Result: Cannot answer the question from the compressed context alone. The head-tail compression algorithm preserved the beginning and end of the document but dropped the middle sections that contained the exact information the query asks about.

Note: The local engine uses head-tail compression which retains ~half the budget from the start and ~half from the end. For queries targeting mid-document content, this strategy misses critical information.

📊 Verdict — When Compression Works (and When It Doesn't)

Test A · Full Context

✅ PASS

Complete answer covering QoS class definitions, eviction ordering, kubelet mechanisms, and thresholds. All details sourced directly from the context.

Test B · Compressed Context

❌ FAIL

Could not answer the query. The head-tail compression preserved the introduction (scheduling) and conclusion (optimization strategies) but dropped the Resource Management section containing QoS classes and node pressure eviction — the exact information the query needed.

Why It Failed

The query asked about a mid-document topic. Head-tail compression (keeps start + end) is great for queries about the opening or closing content but systematically drops middle sections. The two critical sections — "Quality of Service Classes" and "Node Pressure Eviction" — both lived in the middle of the document.

The Real SuperCompress Fix

This test uses the local Python engine's head-tail fallback. The full hosted SuperCompress API (precision mode) uses a learned eviction policy + verifier that scores each block against the query rather than blindly keeping head/tail. In practice, the hosted API would likely retain the QoS and eviction sections because they're directly relevant to the query.

🔬 Methodology

  1. Generate a 1,097-word technical document about Kubernetes scheduling and resource management.
  2. Call SuperCompress via compress_for_turn(context, query, budget_ratio=0.35) — the local Python engine. Output used as-is, no editing.
  3. Test A: Pass the full context + query to the coding agent (Buffy). Record answer.
  4. Test B: Pass the compressed context + query (exactly as SuperCompress returned it) to the same coding agent. Record answer.
  5. Compare both answers for correctness, completeness, and detail.

Note: The local engine uses a simple head-tail compression policy. The hosted SuperCompress API (supercompress.dev) uses a learned query-aware eviction policy that scores each block against the query, which would keep query-relevant mid-document sections. This test demonstrates the limitation of the basic fallback — not the full product.