Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ members = [
]

[workspace.package]
version = "0.3.72"
version = "0.3.73"
edition = "2024"
license = "MIT"
repository = "https://github.com/profullstack/c0mpute"
Expand Down
2 changes: 1 addition & 1 deletion apps/desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@c0mpute/desktop",
"productName": "c0mpute",
"desktopName": "c0mpute-desktop.desktop",
"version": "0.3.72",
"version": "0.3.73",
"private": true,
"type": "module",
"description": "c0mpute desktop: chat, agent with your MCP servers and skills, node manager, hosting and tasks, with the c0mpute CLI bundled.",
Expand Down
2 changes: 1 addition & 1 deletion apps/tui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@c0mpute/tui",
"version": "0.3.72",
"version": "0.3.73",
"private": true,
"type": "module",
"bin": {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "c0mpute",
"version": "0.3.72",
"version": "0.3.73",
"private": true,
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/src/app/releases/latest.json/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const dynamic = "force-dynamic";
* this in sync with the workspace version in `Cargo.toml` on each release so a
* freshly built CLI reports "already latest" rather than a phantom upgrade.
*/
const FALLBACK_VERSION = "0.3.72";
const FALLBACK_VERSION = "0.3.73";
const FALLBACK_MIN_REQUIRED = "0.0.1";

type Channel = "stable" | "beta" | "nightly";
Expand Down
9 changes: 9 additions & 0 deletions node/crates/c0mpute-core/src/buyer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ pub struct AuctionOutcome {
/// Opens the result the worker sealed to us (the chunk the receipt's
/// `output_hash` names is ciphertext). Never leaves this process.
pub result_key: c0mpute_net::topics::JobKey,
/// Workers that won this auction earlier and failed the job or sent no
/// receipt in time (it was re-awarded past them). Callers bench them.
pub failed_workers: Vec<String>,
}

impl AuctionOutcome {
Expand Down Expand Up @@ -466,6 +469,7 @@ pub async fn run_auction(net: Arc<Libp2pNetwork>, auction: JobAuction) -> Result
// fresh on a new model won every chat and failed each after ~60 s).
let awarded_at = Instant::now();
let mut reawards = 0usize;
let mut failed_workers: Vec<String> = Vec::new();
'receipts: loop {
while Instant::now() < recv_deadline {
let remaining = recv_deadline.saturating_duration_since(Instant::now());
Expand Down Expand Up @@ -549,6 +553,7 @@ pub async fn run_auction(net: Arc<Libp2pNetwork>, auction: JobAuction) -> Result
next = %next.bidder_peer_id,
"buyer: worker failed the job; re-awarding to the next bidder"
);
failed_workers.push(failed.bid.bidder_peer_id.clone());
match award(&net, &auction, &offer, &session, &topic, &job_id, &next).await {
Ok(a) => {
reawards += 1;
Expand All @@ -568,6 +573,7 @@ pub async fn run_auction(net: Arc<Libp2pNetwork>, auction: JobAuction) -> Result
receipt,
external_ref: auction.external_ref.clone(),
result_key: a.result_key,
failed_workers: failed_workers.clone(),
});
}
}
Expand All @@ -586,6 +592,7 @@ pub async fn run_auction(net: Arc<Libp2pNetwork>, auction: JobAuction) -> Result
receipt,
external_ref: auction.external_ref.clone(),
result_key: a.result_key,
failed_workers: failed_workers.clone(),
});
}
Ok(Ok(_)) => continue,
Expand All @@ -608,6 +615,7 @@ pub async fn run_auction(net: Arc<Libp2pNetwork>, auction: JobAuction) -> Result
next = %next.bidder_peer_id,
"buyer: no receipt in time; re-awarding to the next bidder"
);
failed_workers.push(winner.bidder_peer_id.clone());
match award(&net, &auction, &offer, &session, &topic, &job_id, &next).await {
Ok(a) => {
reawards += 1;
Expand Down Expand Up @@ -851,6 +859,7 @@ pub async fn resume_auction(
receipt,
external_ref: job.external_ref.clone(),
result_key: key,
failed_workers: Vec::new(),
};
// A receipt is only taken from the winner itself, for this job.
let valid = |r: &JobReceipt| r.job_id == job.job_id && r.worker_peer_id == job.winner_peer;
Expand Down
14 changes: 14 additions & 0 deletions node/crates/c0mpute-core/src/dispatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -686,8 +686,13 @@ pub(crate) fn live_tags(workload_type: &str, advertised: &[String], inference_mo
let role = crate::inference::ROLE_TAG;
let model_prefix = crate::inference::model_tag("");
tags.retain(|t| t.as_str() != role && !t.starts_with(&model_prefix));
tags.retain(|t| t.as_str() != crate::inference::ACCEPT_TAG);
if !inference_models.is_empty() {
tags.push(role.to_string());
// Offers that accept alternative models require this tag (0.3.71).
// It has to be added here: the boot snapshot predates the runtime's
// model list, so it never carried it and widened offers got no bids.
tags.push(crate::inference::ACCEPT_TAG.to_string());
tags.extend(inference_models.iter().map(|m| crate::inference::model_tag(m)));
}
}
Expand Down Expand Up @@ -1110,6 +1115,15 @@ mod tests {
assert!(!stale.contains(&crate::inference::model_tag("qwen2.5:0.5b")));
// Other workloads keep their snapshot untouched.
assert_eq!(live_tags("diffusion.txt2img", &boot, &models), boot);
// An offer that accepts alternatives needs the accept tag, which only
// the live set has (the boot snapshot predates the model list).
let mut widened = offer_at(NOW, None);
widened.workload_type = crate::inference::WORKLOAD.into();
widened.required_capabilities = crate::inference::required_capabilities(&serde_json::json!({
"v": 1, "model": "qwen2.5:7b", "accept_models": ["qwen3:4b"], "messages": [{"role": "user", "content": "hi"}]
}));
assert!(missing_capabilities(&widened, &live_tags(w, &boot, &models)).is_empty());
assert_eq!(missing_capabilities(&widened, &live_tags(w, &boot, &[])).len(), 2, "no models served: neither tag");
}

#[test]
Expand Down
10 changes: 9 additions & 1 deletion node/crates/c0mpute-core/src/inference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,15 @@ async fn run(base: &str, spec: &Value, ready: &[String]) -> Result<Value> {
// ─── worker runner ────────────────────────────────────────────────────────

pub fn worker_load() -> WorkerLoad {
WorkerLoad::new(Arc::new(tokio::sync::Semaphore::new(MAX_CONCURRENT)), MAX_CONCURRENT)
// Job times survive restarts like every other workload's (runner::with_history):
// without it each update reset every node's ETA to the 60 s placeholder, and
// the bench score alone picked winners until real jobs finished again.
WorkerLoad::new(Arc::new(tokio::sync::Semaphore::new(MAX_CONCURRENT)), MAX_CONCURRENT).with_history(
crate::config::data_dir()
.unwrap_or_else(|| std::path::PathBuf::from("./c0mpute-data"))
.join("job-times")
.join(format!("{WORKLOAD}.ms")),
)
}

/// Bid only on valid specs for a model served right now.
Expand Down
23 changes: 23 additions & 0 deletions node/crates/c0mpute-core/src/jobs_gateway.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ pub struct JobsBridge {
allow_peers: Arc<Vec<String>>,
bid_window: Duration,
slots: Arc<Semaphore>,
/// Workers that won and then failed or went silent, benched for this
/// bridge's auctions (30 min, doubling to 6 h; a delivery clears it).
/// Benched workers still win when nobody else bids. Persisted: the bridge
/// restarts on every auto-update.
penalties: crate::penalty_box::PenaltyBox,
}

impl JobsBridge {
Expand All @@ -191,6 +196,11 @@ impl JobsBridge {
allow_peers: Arc::new(allow_peers),
bid_window: DEFAULT_BID_WINDOW,
slots: Arc::new(Semaphore::new(MAX_CONCURRENT_JOBS)),
penalties: crate::penalty_box::PenaltyBox::persistent(
crate::config::data_dir()
.unwrap_or_else(|| std::path::PathBuf::from("./c0mpute-data"))
.join("jobs-bridge-penalties.json"),
),
})
}

Expand Down Expand Up @@ -503,6 +513,7 @@ async fn run_job(
let auction = JobAuction::new(workload.name(), spec_inline)
.with_required_capabilities(required)
.with_allowed_bidders(allowed.clone())
.with_fallback_bidders(state.penalties.benched())
.with_max_price_usd(max_price)
.with_bid_window(state.bid_window)
.with_deadline(remaining)
Expand All @@ -519,6 +530,7 @@ async fn run_job(
let auction = JobAuction::new(workload.name(), exact.clone())
.with_required_capabilities(workload.required_capabilities(&exact))
.with_allowed_bidders(allowed.clone())
.with_fallback_bidders(state.penalties.benched())
.with_max_price_usd(max_price)
.with_bid_window(state.bid_window)
.with_deadline(remaining)
Expand All @@ -539,6 +551,17 @@ async fn run_job(
})?;

let worker = outcome.accepted_bid.bidder_peer_id.clone();
// A worker that won and failed (or went silent) loses its turn for a
// while; one that delivered is in good standing again. Before this the
// bridge never benched anyone: a node that could not take jobs kept
// winning and cost each one a ~50 s re-award (sergey-234, 2026-11-15).
for failed in &outcome.failed_workers {
let bench = state.penalties.strike(failed);
tracing::info!(worker = %failed, bench_secs = bench.as_secs(), "jobs bridge: worker failed a job, benched");
}
if outcome.receipt.status == JobStatus::Completed {
state.penalties.clear(&worker);
}
let worker_failed = |detail: &str| {
ApiError(
StatusCode::BAD_GATEWAY,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "c0mpute-monorepo",
"version": "0.3.72",
"version": "0.3.73",
"private": true,
"workspaces": [
"apps/*",
Expand Down
2 changes: 1 addition & 1 deletion packages/captcha/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@profullstack/c0mpute-captcha",
"version": "0.3.72",
"version": "0.3.73",
"description": "Solve image, slider, gap, click-text, audio and math captchas on the c0mpute network: library (fetch().then(solveCaptcha)), CLI and stdio MCP server.",
"type": "module",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion packages/shared/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@c0mpute/shared",
"version": "0.3.72",
"version": "0.3.73",
"private": true,
"type": "module",
"main": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion plugins/ad-generator-agent/module.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
[module]
id = "ad-generator-agent"
name = "Ad Generator Agent — every ad type from one URL"
version = "0.3.72"
version = "0.3.73"
kind = "service"
category = "applications"
status = "available"
Expand Down
Loading