diff options
| author | Dan Engelbrecht <[email protected]> | 2026-04-13 19:17:09 +0200 |
|---|---|---|
| committer | GitHub Enterprise <[email protected]> | 2026-04-13 19:17:09 +0200 |
| commit | 3d59b5d7036c35fe484d052ff32dbdc9d0a75cf7 (patch) | |
| tree | 8d24babc8cd3d097800af0bd960c7ba1d72927d7 | |
| parent | use mimalloc by default (#952) (diff) | |
| download | zen-3d59b5d7036c35fe484d052ff32dbdc9d0a75cf7.tar.xz zen-3d59b5d7036c35fe484d052ff32dbdc9d0a75cf7.zip | |
fix utf characters in source code (#953)
88 files changed, 321 insertions, 321 deletions
diff --git a/src/zen/cmds/builds_cmd.cpp b/src/zen/cmds/builds_cmd.cpp index 60e6608b0..9a1ec2378 100644 --- a/src/zen/cmds/builds_cmd.cpp +++ b/src/zen/cmds/builds_cmd.cpp @@ -2012,7 +2012,7 @@ namespace builds_impl { } // namespace builds_impl ////////////////////////////////////////////////////////////////////////////////////////////////////// -// BuildsCommand — Option-adding helpers +// BuildsCommand - Option-adding helpers // void diff --git a/src/zen/cmds/exec_cmd.cpp b/src/zen/cmds/exec_cmd.cpp index 89bbf3638..93bf24caa 100644 --- a/src/zen/cmds/exec_cmd.cpp +++ b/src/zen/cmds/exec_cmd.cpp @@ -116,7 +116,7 @@ namespace { } // namespace ////////////////////////////////////////////////////////////////////////// -// ExecSessionConfig — read-only configuration for a session run +// ExecSessionConfig - read-only configuration for a session run struct ExecSessionConfig { @@ -137,7 +137,7 @@ struct ExecSessionConfig }; ////////////////////////////////////////////////////////////////////////// -// ExecSessionRunner — owns per-run state, drives the session lifecycle +// ExecSessionRunner - owns per-run state, drives the session lifecycle class ExecSessionRunner { diff --git a/src/zen/cmds/service_cmd.cpp b/src/zen/cmds/service_cmd.cpp index 37baf5483..5e284cbdf 100644 --- a/src/zen/cmds/service_cmd.cpp +++ b/src/zen/cmds/service_cmd.cpp @@ -320,7 +320,7 @@ ServiceCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) throw OptionParseException("'verb' option is required", m_Options.help()); } - // Parse subcommand permissively — forward unrecognised options to the parent parser. + // Parse subcommand permissively - forward unrecognised options to the parent parser. std::vector<std::string> SubUnmatched; if (!ParseOptionsPermissive(*SubOption, gsl::narrow<int>(SubCommandArguments.size()), SubCommandArguments.data(), SubUnmatched)) { diff --git a/src/zen/cmds/ui_cmd.cpp b/src/zen/cmds/ui_cmd.cpp index 4846b4d18..28ab6c45c 100644 --- a/src/zen/cmds/ui_cmd.cpp +++ b/src/zen/cmds/ui_cmd.cpp @@ -162,7 +162,7 @@ UiCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) Labels.push_back(fmt::format("(all {} instances)", Servers.size())); const int32_t Cols = static_cast<int32_t>(TuiConsoleColumns()); - constexpr int32_t kIndicator = 3; // " ▶ " or " " prefix + constexpr int32_t kIndicator = 3; // " > " or " " prefix constexpr int32_t kSeparator = 2; // " " before cmdline constexpr int32_t kEllipsis = 3; // "..." diff --git a/src/zen/cmds/workspaces_cmd.cpp b/src/zen/cmds/workspaces_cmd.cpp index 9e49b464e..1ae2d58fa 100644 --- a/src/zen/cmds/workspaces_cmd.cpp +++ b/src/zen/cmds/workspaces_cmd.cpp @@ -137,7 +137,7 @@ WorkspaceCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** argv) throw OptionParseException("'verb' option is required", m_Options.help()); } - // Parse subcommand permissively — forward unrecognised options to the parent parser. + // Parse subcommand permissively - forward unrecognised options to the parent parser. std::vector<std::string> SubUnmatched; if (!ParseOptionsPermissive(*SubOption, gsl::narrow<int>(SubCommandArguments.size()), SubCommandArguments.data(), SubUnmatched)) { @@ -403,7 +403,7 @@ WorkspaceShareCommand::Run(const ZenCliOptions& GlobalOptions, int argc, char** throw OptionParseException("'verb' option is required", m_Options.help()); } - // Parse subcommand permissively — forward unrecognised options to the parent parser. + // Parse subcommand permissively - forward unrecognised options to the parent parser. std::vector<std::string> SubUnmatched; if (!ParseOptionsPermissive(*SubOption, gsl::narrow<int>(SubCommandArguments.size()), SubCommandArguments.data(), SubUnmatched)) { diff --git a/src/zen/progressbar.cpp b/src/zen/progressbar.cpp index d39b756ae..7a0668b80 100644 --- a/src/zen/progressbar.cpp +++ b/src/zen/progressbar.cpp @@ -295,7 +295,7 @@ ProgressBar::RenderStatusLine(std::string_view Line) uint32_t CurrentRows = TuiConsoleRows(0); if (CurrentRows >= 3 && CurrentRows != m_ScrollRegionRows) { - // Terminal was resized — reinstall scroll region + // Terminal was resized - reinstall scroll region TuiSetScrollRegion(1, CurrentRows - 1); m_ScrollRegionRows = CurrentRows; } @@ -304,12 +304,12 @@ ProgressBar::RenderStatusLine(std::string_view Line) // is atomic and log output from other threads cannot interleave. ExtendableStringBuilder<512> Buf; Buf << "\x1b" - "7" // ESC 7 — save cursor + "7" // ESC 7 - save cursor << fmt::format("\x1b[{};1H", m_ScrollRegionRows) // move to bottom row << "\x1b[2K" // erase entire line << Line // progress bar content << "\x1b" - "8"; // ESC 8 — restore cursor + "8"; // ESC 8 - restore cursor OutputToConsoleRaw(Buf); } diff --git a/src/zen/zen.cpp b/src/zen/zen.cpp index bbf6b4f8a..0229db4a8 100644 --- a/src/zen/zen.cpp +++ b/src/zen/zen.cpp @@ -369,7 +369,7 @@ ZenCmdWithSubCommands::Run(const ZenCliOptions& GlobalOptions, int argc, char** } } - // Parse subcommand args permissively — unrecognised options are collected + // Parse subcommand args permissively - unrecognised options are collected // and forwarded to the parent parser so that parent options (e.g. --path) // can appear after the subcommand name on the command line. std::vector<std::string> SubUnmatched; diff --git a/src/zencompute/cloudmetadata.cpp b/src/zencompute/cloudmetadata.cpp index eb4c05f9f..f1df18e8e 100644 --- a/src/zencompute/cloudmetadata.cpp +++ b/src/zencompute/cloudmetadata.cpp @@ -183,7 +183,7 @@ CloudMetadata::TryDetectAWS() m_Info.AvailabilityZone = std::string(AzResponse.AsText()); } - // "spot" vs "on-demand" — determines whether the instance can be + // "spot" vs "on-demand" - determines whether the instance can be // reclaimed by AWS with a 2-minute warning HttpClient::Response LifecycleResponse = ImdsClient.Get("/latest/meta-data/instance-life-cycle", AuthHeaders); if (LifecycleResponse.IsSuccess()) @@ -273,7 +273,7 @@ CloudMetadata::TryDetectAzure() std::string Priority = Compute["priority"].string_value(); m_Info.IsSpot = (Priority == "Spot"); - // Check if part of a VMSS (Virtual Machine Scale Set) — indicates autoscaling + // Check if part of a VMSS (Virtual Machine Scale Set) - indicates autoscaling std::string VmssName = Compute["vmScaleSetName"].string_value(); m_Info.IsAutoscaling = !VmssName.empty(); @@ -609,7 +609,7 @@ namespace zen::compute { TEST_SUITE_BEGIN("compute.cloudmetadata"); // --------------------------------------------------------------------------- -// Test helper — spins up a local ASIO HTTP server hosting a MockImdsService +// Test helper - spins up a local ASIO HTTP server hosting a MockImdsService // --------------------------------------------------------------------------- struct TestImdsServer @@ -974,7 +974,7 @@ TEST_CASE("cloudmetadata.sentinel_files") SUBCASE("only failed providers get sentinels") { - // Switch to AWS — Azure and GCP never probed, so no sentinels for them + // Switch to AWS - Azure and GCP never probed, so no sentinels for them Imds.Mock.ActiveProvider = CloudProvider::AWS; auto Cloud = Imds.CreateCloud(); diff --git a/src/zencompute/computeservice.cpp b/src/zencompute/computeservice.cpp index 852e93fa0..7f354a51c 100644 --- a/src/zencompute/computeservice.cpp +++ b/src/zencompute/computeservice.cpp @@ -449,7 +449,7 @@ ComputeServiceSession::Impl::RequestStateTransition(SessionState NewState) return true; } - // CAS failed, Current was updated — retry with the new value + // CAS failed, Current was updated - retry with the new value } } @@ -1612,7 +1612,7 @@ ComputeServiceSession::Impl::SchedulePendingActions() // Also note that the m_PendingActions list is not maintained // here, that's done periodically in SchedulePendingActions() - // Extract pending actions under a shared lock — we only need to read + // Extract pending actions under a shared lock - we only need to read // the map and take Ref copies. ActionState() is atomic so this is safe. // Sorting and capacity trimming happen outside the lock to avoid // blocking HTTP handlers on O(N log N) work with large pending queues. @@ -1741,7 +1741,7 @@ ComputeServiceSession::Impl::SchedulerThreadFunction() HandleActionUpdates(); - // Auto-transition Draining → Paused when all work is done + // Auto-transition Draining -> Paused when all work is done if (m_SessionState.load(std::memory_order_relaxed) == SessionState::Draining) { bool AllDrained = m_ActionMapLock.WithSharedLock([&] { return m_PendingActions.empty() && m_RunningMap.empty(); }); @@ -1866,7 +1866,7 @@ ComputeServiceSession::Impl::RescheduleAction(int ActionLsn) } } - // Reset action state — this calls PostUpdate() internally + // Reset action state - this calls PostUpdate() internally Action->ResetActionStateToPending(); int NewRetryCount = Action->RetryCount.load(std::memory_order_relaxed); @@ -1948,7 +1948,7 @@ ComputeServiceSession::Impl::HandleActionUpdates() // This is safe because state transitions are monotonically increasing by enum // rank (Pending < Submitting < Running < Completed/Failed/Cancelled), so // SetActionState rejects any transition to a lower-ranked state. By the time - // we read ActionState() here, it reflects the highest state reached — making + // we read ActionState() here, it reflects the highest state reached - making // the first occurrence per LSN authoritative and duplicates redundant. for (Ref<RunnerAction>& Action : UpdatedActions) { @@ -1958,7 +1958,7 @@ ComputeServiceSession::Impl::HandleActionUpdates() { switch (Action->ActionState()) { - // Newly enqueued — add to pending map for scheduling + // Newly enqueued - add to pending map for scheduling case RunnerAction::State::Pending: // Guard against a race where the session is abandoned between // EnqueueAction (which calls PostUpdate) and this scheduler @@ -1979,11 +1979,11 @@ ComputeServiceSession::Impl::HandleActionUpdates() } break; - // Async submission in progress — remains in pending map + // Async submission in progress - remains in pending map case RunnerAction::State::Submitting: break; - // Dispatched to a runner — move from pending to running + // Dispatched to a runner - move from pending to running case RunnerAction::State::Running: m_ActionMapLock.WithExclusiveLock([&] { m_RunningMap.insert({ActionLsn, Action}); @@ -1992,7 +1992,7 @@ ComputeServiceSession::Impl::HandleActionUpdates() ZEN_DEBUG("action {} ({}) RUNNING", Action->ActionId, ActionLsn); break; - // Retracted — pull back for rescheduling without counting against retry limit + // Retracted - pull back for rescheduling without counting against retry limit case RunnerAction::State::Retracted: { m_ActionMapLock.WithExclusiveLock([&] { @@ -2004,7 +2004,7 @@ ComputeServiceSession::Impl::HandleActionUpdates() break; } - // Rejected — runner was at capacity, reschedule without retry cost + // Rejected - runner was at capacity, reschedule without retry cost case RunnerAction::State::Rejected: { Action->ResetActionStateToPending(); @@ -2012,7 +2012,7 @@ ComputeServiceSession::Impl::HandleActionUpdates() break; } - // Terminal states — move to results, record history, notify queue + // Terminal states - move to results, record history, notify queue case RunnerAction::State::Completed: case RunnerAction::State::Failed: case RunnerAction::State::Abandoned: @@ -2021,7 +2021,7 @@ ComputeServiceSession::Impl::HandleActionUpdates() auto TerminalState = Action->ActionState(); // Automatic retry for Failed/Abandoned actions with retries remaining. - // Skip retries when the session itself is abandoned — those actions + // Skip retries when the session itself is abandoned - those actions // were intentionally abandoned and should not be rescheduled. if ((TerminalState == RunnerAction::State::Failed || TerminalState == RunnerAction::State::Abandoned) && m_SessionState.load(std::memory_order_relaxed) < SessionState::Abandoned) diff --git a/src/zencompute/httpcomputeservice.cpp b/src/zencompute/httpcomputeservice.cpp index 8cbb25afd..5ab189d89 100644 --- a/src/zencompute/httpcomputeservice.cpp +++ b/src/zencompute/httpcomputeservice.cpp @@ -78,13 +78,13 @@ struct HttpComputeService::Impl std::string ClientHostname; // empty if no hostname was provided }; - // Remote queue registry — all three maps share the same RemoteQueueInfo objects. + // Remote queue registry - all three maps share the same RemoteQueueInfo objects. // All maps are guarded by m_RemoteQueueLock. RwLock m_RemoteQueueLock; - std::unordered_map<Oid, Ref<RemoteQueueInfo>, Oid::Hasher> m_RemoteQueuesByToken; // Token → info - std::unordered_map<int, Ref<RemoteQueueInfo>> m_RemoteQueuesByQueueId; // QueueId → info - std::unordered_map<std::string, Ref<RemoteQueueInfo>> m_RemoteQueuesByTag; // idempotency key → info + std::unordered_map<Oid, Ref<RemoteQueueInfo>, Oid::Hasher> m_RemoteQueuesByToken; // Token -> info + std::unordered_map<int, Ref<RemoteQueueInfo>> m_RemoteQueuesByQueueId; // QueueId -> info + std::unordered_map<std::string, Ref<RemoteQueueInfo>> m_RemoteQueuesByTag; // idempotency key -> info LoggerRef Log() { return m_Log; } @@ -672,7 +672,7 @@ HttpComputeService::Impl::RegisterRoutes() }, HttpVerb::kGet | HttpVerb::kPost); - // Queue creation routes — these remain separate since local creates a plain queue + // Queue creation routes - these remain separate since local creates a plain queue // while remote additionally generates an OID token for external access. m_Router.RegisterRoute( @@ -726,7 +726,7 @@ HttpComputeService::Impl::RegisterRoutes() return HttpReq.WriteResponse(HttpResponseCode::OK, Cbo.Save()); } - // Queue has since expired — clean up stale entries and fall through to create a new one + // Queue has since expired - clean up stale entries and fall through to create a new one m_RemoteQueuesByToken.erase(Existing->Token); m_RemoteQueuesByQueueId.erase(Existing->QueueId); m_RemoteQueuesByTag.erase(It); @@ -755,7 +755,7 @@ HttpComputeService::Impl::RegisterRoutes() }, HttpVerb::kPost); - // Unified queue routes — {queueref} accepts both local integer IDs and remote OID tokens. + // Unified queue routes - {queueref} accepts both local integer IDs and remote OID tokens. // ResolveQueueRef() handles access control (local-only for integer IDs) and token resolution. m_Router.RegisterRoute( @@ -1105,7 +1105,7 @@ HttpComputeService::Impl::RegisterRoutes() }, HttpVerb::kPost); - // WebSocket upgrade endpoint — the handler logic lives in + // WebSocket upgrade endpoint - the handler logic lives in // HttpComputeService::OnWebSocket* methods; this route merely // satisfies the router so the upgrade request isn't rejected. m_Router.RegisterRoute( @@ -1241,7 +1241,7 @@ HttpComputeService::Impl::ResolveQueueRef(HttpServerRequest& HttpReq, std::strin { if (OidMatcher(Capture)) { - // Remote OID token — accessible from any client + // Remote OID token - accessible from any client const Oid Token = Oid::FromHexString(Capture); const int QueueId = ResolveQueueToken(Token); @@ -1253,7 +1253,7 @@ HttpComputeService::Impl::ResolveQueueRef(HttpServerRequest& HttpReq, std::strin return QueueId; } - // Local integer queue ID — restricted to local machine requests + // Local integer queue ID - restricted to local machine requests if (!HttpReq.IsLocalMachineRequest()) { HttpReq.WriteResponse(HttpResponseCode::Forbidden); @@ -1709,7 +1709,7 @@ HttpComputeService::OnActionsCompleted(std::span<const CompletedActionNotificati ////////////////////////////////////////////////////////////////////////// // -// Impl — WebSocket / observer +// Impl - WebSocket / observer // void diff --git a/src/zencompute/httporchestrator.cpp b/src/zencompute/httporchestrator.cpp index 1f51e560e..56eadcd57 100644 --- a/src/zencompute/httporchestrator.cpp +++ b/src/zencompute/httporchestrator.cpp @@ -478,7 +478,7 @@ HttpOrchestratorService::Shutdown() m_PushThread.join(); } - // Clean up worker WebSocket connections — collect IDs under lock, then + // Clean up worker WebSocket connections - collect IDs under lock, then // notify the service outside the lock to avoid lock-order inversions. std::vector<std::string> WorkerIds; m_WorkerWsLock.WithExclusiveLock([&] { @@ -582,7 +582,7 @@ std::string HttpOrchestratorService::HandleWorkerWebSocketMessage(const WebSocketMessage& Msg) { // Workers send CbObject in native binary format over the WebSocket to - // avoid the lossy CbObject↔JSON round-trip. + // avoid the lossy CbObject<->JSON round-trip. CbObject Data = CbObject::MakeView(Msg.Payload.GetData()); if (!Data) { diff --git a/src/zencompute/include/zencompute/cloudmetadata.h b/src/zencompute/include/zencompute/cloudmetadata.h index 3b9642ac3..280d794e7 100644 --- a/src/zencompute/include/zencompute/cloudmetadata.h +++ b/src/zencompute/include/zencompute/cloudmetadata.h @@ -64,7 +64,7 @@ public: explicit CloudMetadata(std::filesystem::path DataDir); /** Synchronously probes cloud providers at the given IMDS endpoint. - * Intended for testing — allows redirecting all IMDS queries to a local + * Intended for testing - allows redirecting all IMDS queries to a local * mock HTTP server instead of the real 169.254.169.254 endpoint. */ CloudMetadata(std::filesystem::path DataDir, std::string ImdsEndpoint); diff --git a/src/zencompute/include/zencompute/httporchestrator.h b/src/zencompute/include/zencompute/httporchestrator.h index ef0a1269a..4e4f5f0f8 100644 --- a/src/zencompute/include/zencompute/httporchestrator.h +++ b/src/zencompute/include/zencompute/httporchestrator.h @@ -108,9 +108,9 @@ private: Event m_PushEvent; void PushThreadFunction(); - // Worker WebSocket connections (worker→orchestrator persistent links) + // Worker WebSocket connections (worker->orchestrator persistent links) RwLock m_WorkerWsLock; - std::unordered_map<WebSocketConnection*, std::string> m_WorkerWsMap; // connection ptr → worker ID + std::unordered_map<WebSocketConnection*, std::string> m_WorkerWsMap; // connection ptr -> worker ID std::string HandleWorkerWebSocketMessage(const WebSocketMessage& Msg); #endif }; diff --git a/src/zencompute/include/zencompute/mockimds.h b/src/zencompute/include/zencompute/mockimds.h index 704306913..6074240b9 100644 --- a/src/zencompute/include/zencompute/mockimds.h +++ b/src/zencompute/include/zencompute/mockimds.h @@ -1,5 +1,5 @@ // Copyright Epic Games, Inc. All Rights Reserved. -// Moved to zenutil — this header is kept for backward compatibility. +// Moved to zenutil - this header is kept for backward compatibility. #pragma once diff --git a/src/zencompute/orchestratorservice.cpp b/src/zencompute/orchestratorservice.cpp index aee8fa63a..68199ab3c 100644 --- a/src/zencompute/orchestratorservice.cpp +++ b/src/zencompute/orchestratorservice.cpp @@ -180,11 +180,11 @@ OrchestratorService::SetWorkerWebSocketConnected(std::string_view WorkerId, bool if (Connected) { - ZEN_INFO("worker {} WebSocket connected — marking reachable", WorkerId); + ZEN_INFO("worker {} WebSocket connected - marking reachable", WorkerId); } else { - ZEN_WARN("worker {} WebSocket disconnected — marking unreachable", WorkerId); + ZEN_WARN("worker {} WebSocket disconnected - marking unreachable", WorkerId); } }); @@ -617,7 +617,7 @@ OrchestratorService::ProbeThreadFunction() continue; } - // Check if the provisioner knows this worker is draining — if so, + // Check if the provisioner knows this worker is draining - if so, // unreachability is expected and should not be logged as a warning. bool IsDraining = false; if (IProvisionerStateProvider* Prov = m_Provisioner.load(std::memory_order_acquire)) diff --git a/src/zencompute/pathvalidation.h b/src/zencompute/pathvalidation.h index c2e30183a..d50ad4a2a 100644 --- a/src/zencompute/pathvalidation.h +++ b/src/zencompute/pathvalidation.h @@ -78,7 +78,7 @@ ValidateSandboxRelativePath(std::string_view Name) throw zen::invalid_argument("path traversal detected: '{}' contains '..' component", Name); } - // Skip "." (current directory) — harmless in relative paths + // Skip "." (current directory) - harmless in relative paths if (ComponentStr != ".") { ValidatePathComponent(ComponentStr, Name); diff --git a/src/zencompute/runners/functionrunner.cpp b/src/zencompute/runners/functionrunner.cpp index ab22c6363..34bf065b4 100644 --- a/src/zencompute/runners/functionrunner.cpp +++ b/src/zencompute/runners/functionrunner.cpp @@ -126,7 +126,7 @@ BaseRunnerGroup::SubmitActions(const std::vector<Ref<RunnerAction>>& Actions) ZEN_TRACE_CPU("BaseRunnerGroup::SubmitActions"); // Snapshot runners and query capacity under the lock, then release - // before submitting — HTTP submissions to remote runners can take + // before submitting - HTTP submissions to remote runners can take // hundreds of milliseconds and we must not hold m_RunnersLock during I/O. std::vector<Ref<FunctionRunner>> Runners; @@ -192,7 +192,7 @@ BaseRunnerGroup::SubmitActions(const std::vector<Ref<RunnerAction>>& Actions) } } - // Submit batches per runner — in parallel when a worker pool is available + // Submit batches per runner - in parallel when a worker pool is available std::vector<std::vector<SubmitResult>> PerRunnerResults(RunnerCount); @@ -414,7 +414,7 @@ RunnerAction::ResetActionStateToPending() CpuUsagePercent.store(-1.0f, std::memory_order_relaxed); CpuSeconds.store(0.0f, std::memory_order_relaxed); - // Increment retry count (skip for Retracted/Rejected — nothing failed) + // Increment retry count (skip for Retracted/Rejected - nothing failed) if (CurrentState != State::Retracted && CurrentState != State::Rejected) { RetryCount.fetch_add(1, std::memory_order_relaxed); diff --git a/src/zencompute/runners/functionrunner.h b/src/zencompute/runners/functionrunner.h index 449f0e228..371a60b7a 100644 --- a/src/zencompute/runners/functionrunner.h +++ b/src/zencompute/runners/functionrunner.h @@ -192,7 +192,7 @@ struct RunnerAction : public RefCounted Completed, // Finished successfully with results available Failed, // Execution failed (transient error, eligible for retry) Abandoned, // Infrastructure termination (e.g. spot eviction, session abandon) - Rejected, // Runner declined (e.g. at capacity) — rescheduled without retry cost + Rejected, // Runner declined (e.g. at capacity) - rescheduled without retry cost Cancelled, // Intentional user cancellation (never retried) Retracted, // Pulled back for rescheduling on a different runner (no retry cost) _Count diff --git a/src/zencompute/runners/linuxrunner.cpp b/src/zencompute/runners/linuxrunner.cpp index ce5bbdcc8..be4274823 100644 --- a/src/zencompute/runners/linuxrunner.cpp +++ b/src/zencompute/runners/linuxrunner.cpp @@ -195,7 +195,7 @@ namespace { WriteErrorAndExit(ErrorPipeFd, "bind mount /lib failed", errno); } - // /lib64 (optional — not all distros have it) + // /lib64 (optional - not all distros have it) { struct stat St; if (stat("/lib64", &St) == 0 && S_ISDIR(St.st_mode)) @@ -208,7 +208,7 @@ namespace { } } - // /etc (required — for resolv.conf, ld.so.cache, etc.) + // /etc (required - for resolv.conf, ld.so.cache, etc.) if (MkdirIfNeeded(BuildPath("etc"), 0755) != 0) { WriteErrorAndExit(ErrorPipeFd, "mkdir sandbox/etc failed", errno); @@ -218,7 +218,7 @@ namespace { WriteErrorAndExit(ErrorPipeFd, "bind mount /etc failed", errno); } - // /worker — bind-mount worker directory (contains the executable) + // /worker - bind-mount worker directory (contains the executable) if (MkdirIfNeeded(BuildPath("worker"), 0755) != 0) { WriteErrorAndExit(ErrorPipeFd, "mkdir sandbox/worker failed", errno); @@ -430,12 +430,12 @@ LinuxProcessRunner::SubmitAction(Ref<RunnerAction> Action) if (ChildPid == 0) { - // Child process — lower priority so workers don't starve the main server + // Child process - lower priority so workers don't starve the main server nice(5); if (m_Sandboxed) { - // Close read end of error pipe — child only writes + // Close read end of error pipe - child only writes close(ErrorPipe[0]); SetupNamespaceSandbox(SandboxPathStr.c_str(), CurrentUid, CurrentGid, WorkerPathStr.c_str(), ErrorPipe[1]); @@ -462,7 +462,7 @@ LinuxProcessRunner::SubmitAction(Ref<RunnerAction> Action) if (m_Sandboxed) { - // Close write end of error pipe — parent only reads + // Close write end of error pipe - parent only reads close(ErrorPipe[1]); // Read from error pipe. If execve succeeded, pipe was closed by O_CLOEXEC @@ -679,7 +679,7 @@ ReadProcStatCpuTicks(pid_t Pid) Buf[Len] = '\0'; - // Skip past "pid (name) " — find last ')' to handle names containing spaces or parens + // Skip past "pid (name) " - find last ')' to handle names containing spaces or parens const char* P = strrchr(Buf, ')'); if (!P) { @@ -709,7 +709,7 @@ LinuxProcessRunner::SampleProcessCpu(RunningAction& Running) if (CurrentOsTicks == 0) { - // Process gone or /proc entry unreadable — record timestamp without updating usage + // Process gone or /proc entry unreadable - record timestamp without updating usage Running.LastCpuSampleTicks = NowTicks; Running.LastCpuOsTicks = 0; return; diff --git a/src/zencompute/runners/localrunner.cpp b/src/zencompute/runners/localrunner.cpp index 96cbdc134..259965e23 100644 --- a/src/zencompute/runners/localrunner.cpp +++ b/src/zencompute/runners/localrunner.cpp @@ -337,7 +337,7 @@ LocalProcessRunner::PrepareActionSubmission(Ref<RunnerAction> Action) SubmitResult LocalProcessRunner::SubmitAction(Ref<RunnerAction> Action) { - // Base class is not directly usable — platform subclasses override this + // Base class is not directly usable - platform subclasses override this ZEN_UNUSED(Action); return SubmitResult{.IsAccepted = false}; } @@ -620,7 +620,7 @@ LocalProcessRunner::MonitorThreadFunction() void LocalProcessRunner::CancelRunningActions() { - // Base class is not directly usable — platform subclasses override this + // Base class is not directly usable - platform subclasses override this } void diff --git a/src/zencompute/runners/macrunner.cpp b/src/zencompute/runners/macrunner.cpp index 13c01d988..ab24d4672 100644 --- a/src/zencompute/runners/macrunner.cpp +++ b/src/zencompute/runners/macrunner.cpp @@ -211,19 +211,19 @@ MacProcessRunner::SubmitAction(Ref<RunnerAction> Action) if (ChildPid == 0) { - // Child process — lower priority so workers don't starve the main server + // Child process - lower priority so workers don't starve the main server nice(5); if (m_Sandboxed) { - // Close read end of error pipe — child only writes + // Close read end of error pipe - child only writes close(ErrorPipe[0]); // Apply Seatbelt sandbox profile char* ErrorBuf = nullptr; if (sandbox_init(SandboxProfile.c_str(), 0, &ErrorBuf) != 0) { - // sandbox_init failed — write error to pipe and exit + // sandbox_init failed - write error to pipe and exit if (ErrorBuf) { WriteErrorAndExit(ErrorPipe[1], ErrorBuf, 0); @@ -262,7 +262,7 @@ MacProcessRunner::SubmitAction(Ref<RunnerAction> Action) if (m_Sandboxed) { - // Close write end of error pipe — parent only reads + // Close write end of error pipe - parent only reads close(ErrorPipe[1]); // Read from error pipe. If execve succeeded, pipe was closed by O_CLOEXEC @@ -471,7 +471,7 @@ MacProcessRunner::SampleProcessCpu(RunningAction& Running) const uint64_t CurrentOsTicks = Info.pti_total_user + Info.pti_total_system; const uint64_t NowTicks = GetHifreqTimerValue(); - // Cumulative CPU seconds (absolute, available from first sample): ns → seconds + // Cumulative CPU seconds (absolute, available from first sample): ns -> seconds Running.Action->CpuSeconds.store(static_cast<float>(static_cast<double>(CurrentOsTicks) / 1'000'000'000.0), std::memory_order_relaxed); if (Running.LastCpuSampleTicks != 0 && Running.LastCpuOsTicks != 0) @@ -480,7 +480,7 @@ MacProcessRunner::SampleProcessCpu(RunningAction& Running) if (ElapsedMs > 0) { const uint64_t DeltaOsTicks = CurrentOsTicks - Running.LastCpuOsTicks; - // ns → ms: divide by 1,000,000; then as percent of elapsed ms + // ns -> ms: divide by 1,000,000; then as percent of elapsed ms const float CpuPct = static_cast<float>(static_cast<double>(DeltaOsTicks) / 1'000'000.0 / ElapsedMs * 100.0); Running.Action->CpuUsagePercent.store(CpuPct, std::memory_order_relaxed); } diff --git a/src/zencompute/runners/remotehttprunner.cpp b/src/zencompute/runners/remotehttprunner.cpp index 55f78fdd6..08f381b7f 100644 --- a/src/zencompute/runners/remotehttprunner.cpp +++ b/src/zencompute/runners/remotehttprunner.cpp @@ -263,7 +263,7 @@ RemoteHttpRunner::SubmitActions(const std::vector<Ref<RunnerAction>>& Actions) // Collect distinct QueueIds and ensure remote queues exist once per queue - std::unordered_map<int, Oid> QueueTokens; // QueueId → remote token (0 stays as Zero) + std::unordered_map<int, Oid> QueueTokens; // QueueId -> remote token (0 stays as Zero) for (const Ref<RunnerAction>& Action : Actions) { @@ -416,7 +416,7 @@ RemoteHttpRunner::SubmitAction(Ref<RunnerAction> Action) if (WorkResponseCode == HttpResponseCode::FailedDependency && Attempt == 0) { - ZEN_WARN("remote {} returned FailedDependency for action {} — re-registering worker and retrying", + ZEN_WARN("remote {} returned FailedDependency for action {} - re-registering worker and retrying", m_Http.GetBaseUri(), ActionId); @@ -437,7 +437,7 @@ RemoteHttpRunner::SubmitAction(Ref<RunnerAction> Action) if (WorkResponseCode == HttpResponseCode::FailedDependency && Attempt == 0) { - ZEN_WARN("remote {} returned FailedDependency for action {} — re-registering worker and retrying", + ZEN_WARN("remote {} returned FailedDependency for action {} - re-registering worker and retrying", m_Http.GetBaseUri(), ActionId); @@ -451,7 +451,7 @@ RemoteHttpRunner::SubmitAction(Ref<RunnerAction> Action) if (WorkResponseCode == HttpResponseCode::NotFound) { - // Remote needs attachments — resolve them and retry with a CbPackage + // Remote needs attachments - resolve them and retry with a CbPackage CbPackage Pkg; Pkg.SetObject(ActionObj); @@ -644,7 +644,7 @@ RemoteHttpRunner::SubmitActionBatch(const std::string& SubmitUrl, const std::vec } else { - ZEN_WARN("batch submit: missing attachment {} — falling back to individual submit", NeedHash); + ZEN_WARN("batch submit: missing attachment {} - falling back to individual submit", NeedHash); return FallbackToIndividualSubmit(Actions); } } @@ -656,16 +656,16 @@ RemoteHttpRunner::SubmitActionBatch(const std::string& SubmitUrl, const std::vec return ParseBatchResponse(RetryResponse, Actions); } - ZEN_WARN("batch submit retry failed with {} {} — falling back to individual submit", + ZEN_WARN("batch submit retry failed with {} {} - falling back to individual submit", (int)RetryResponse.StatusCode, ToString(RetryResponse.StatusCode)); return FallbackToIndividualSubmit(Actions); } } - // Unexpected status or connection error — fall back to individual submission + // Unexpected status or connection error - fall back to individual submission - ZEN_WARN("batch submit to {}{} failed — falling back to individual submit", m_Http.GetBaseUri(), SubmitUrl); + ZEN_WARN("batch submit to {}{} failed - falling back to individual submit", m_Http.GetBaseUri(), SubmitUrl); return FallbackToIndividualSubmit(Actions); } @@ -927,7 +927,7 @@ RemoteHttpRunner::MonitorThreadFunction() SweepOnce(); } - // Signal received — may be a WS wakeup or a quit signal + // Signal received - may be a WS wakeup or a quit signal SweepOnce(); } while (m_MonitorThreadEnabled); diff --git a/src/zencompute/runners/remotehttprunner.h b/src/zencompute/runners/remotehttprunner.h index fdf113c77..521bf2f82 100644 --- a/src/zencompute/runners/remotehttprunner.h +++ b/src/zencompute/runners/remotehttprunner.h @@ -96,7 +96,7 @@ private: size_t SweepRunningActions(); RwLock m_QueueTokenLock; - std::unordered_map<int, Oid> m_RemoteQueueTokens; // local QueueId → remote queue token + std::unordered_map<int, Oid> m_RemoteQueueTokens; // local QueueId -> remote queue token // Stable identity for this runner instance, used as part of the idempotency key when // creating remote queues. Generated once at construction and never changes. diff --git a/src/zencompute/runners/windowsrunner.cpp b/src/zencompute/runners/windowsrunner.cpp index e643c9ce8..c6b3e82ea 100644 --- a/src/zencompute/runners/windowsrunner.cpp +++ b/src/zencompute/runners/windowsrunner.cpp @@ -485,7 +485,7 @@ WindowsProcessRunner::SampleProcessCpu(RunningAction& Running) const uint64_t CurrentOsTicks = FtToU64(KernelTime) + FtToU64(UserTime); const uint64_t NowTicks = GetHifreqTimerValue(); - // Cumulative CPU seconds (absolute, available from first sample): 100ns → seconds + // Cumulative CPU seconds (absolute, available from first sample): 100ns -> seconds Running.Action->CpuSeconds.store(static_cast<float>(static_cast<double>(CurrentOsTicks) / 10'000'000.0), std::memory_order_relaxed); if (Running.LastCpuSampleTicks != 0 && Running.LastCpuOsTicks != 0) @@ -494,7 +494,7 @@ WindowsProcessRunner::SampleProcessCpu(RunningAction& Running) if (ElapsedMs > 0) { const uint64_t DeltaOsTicks = CurrentOsTicks - Running.LastCpuOsTicks; - // 100ns → ms: divide by 10000; then as percent of elapsed ms + // 100ns -> ms: divide by 10000; then as percent of elapsed ms const float CpuPct = static_cast<float>(static_cast<double>(DeltaOsTicks) / 10000.0 / ElapsedMs * 100.0); Running.Action->CpuUsagePercent.store(CpuPct, std::memory_order_relaxed); } diff --git a/src/zencompute/runners/winerunner.cpp b/src/zencompute/runners/winerunner.cpp index 593b19e55..29ab93663 100644 --- a/src/zencompute/runners/winerunner.cpp +++ b/src/zencompute/runners/winerunner.cpp @@ -96,7 +96,7 @@ WineProcessRunner::SubmitAction(Ref<RunnerAction> Action) if (ChildPid == 0) { - // Child process — lower priority so workers don't starve the main server + // Child process - lower priority so workers don't starve the main server nice(5); if (chdir(SandboxPathStr.c_str()) != 0) diff --git a/src/zencore/compactbinarypackage.cpp b/src/zencore/compactbinarypackage.cpp index cd268745c..87b58baf7 100644 --- a/src/zencore/compactbinarypackage.cpp +++ b/src/zencore/compactbinarypackage.cpp @@ -1410,7 +1410,7 @@ TEST_CASE("cbpackage.legacy.hashresolution") CbPackage LoadedPkg; CHECK(legacy::TryLoadCbPackage(LoadedPkg, Buffer, &UniqueBuffer::Alloc)); - // The hash-only path requires a mapper — without one it should fail + // The hash-only path requires a mapper - without one it should fail CbWriter HashOnlyCb; HashOnlyCb.AddHash(ObjectAttach.GetHash()); HashOnlyCb.AddNull(); diff --git a/src/zencore/crashhandler.cpp b/src/zencore/crashhandler.cpp index 31b8e6ce2..14904a4b2 100644 --- a/src/zencore/crashhandler.cpp +++ b/src/zencore/crashhandler.cpp @@ -56,7 +56,7 @@ CrashExceptionFilter(PEXCEPTION_POINTERS ExceptionInfo) HANDLE Process = GetCurrentProcess(); HANDLE Thread = GetCurrentThread(); - // SymInitialize is safe to call if already initialized — it returns FALSE + // SymInitialize is safe to call if already initialized - it returns FALSE // but existing state remains valid for SymFromAddr calls SymInitialize(Process, NULL, TRUE); diff --git a/src/zencore/filesystem.cpp b/src/zencore/filesystem.cpp index 518146648..70d0f32b3 100644 --- a/src/zencore/filesystem.cpp +++ b/src/zencore/filesystem.cpp @@ -3329,12 +3329,12 @@ MakeSafeAbsolutePathInPlace(std::filesystem::path& Path) { if (PathString.starts_with(UncPrefix)) { - // UNC path: \\server\share → \\?\UNC\server\share + // UNC path: \\server\share -> \\?\UNC\server\share PathString.replace(0, UncPrefix.size(), LongPathUncPrefix); } else { - // Local path: C:\foo → \\?\C:\foo + // Local path: C:\foo -> \\?\C:\foo PathString.insert(0, LongPathPrefix); } Path = PathString; @@ -4153,7 +4153,7 @@ TEST_CASE("filesystem.MakeSafeAbsolutePath") TEST_CASE("ExpandEnvironmentVariables") { - // No variables — pass-through + // No variables - pass-through CHECK_EQ(ExpandEnvironmentVariables("plain/path"), "plain/path"); CHECK_EQ(ExpandEnvironmentVariables(""), ""); diff --git a/src/zencore/include/zencore/logging/broadcastsink.h b/src/zencore/include/zencore/logging/broadcastsink.h index c2709d87c..474662888 100644 --- a/src/zencore/include/zencore/logging/broadcastsink.h +++ b/src/zencore/include/zencore/logging/broadcastsink.h @@ -17,7 +17,7 @@ namespace zen::logging { /// sink is immediately visible to all of them. This is the recommended way /// to manage "default" sinks that should be active on most loggers. /// -/// Each child sink owns its own Formatter — BroadcastSink::SetFormatter() is +/// Each child sink owns its own Formatter - BroadcastSink::SetFormatter() is /// intentionally a no-op so that per-sink formatting is not accidentally /// overwritten by registry-wide formatter changes. class BroadcastSink : public Sink @@ -63,7 +63,7 @@ public: } } - /// No-op — child sinks manage their own formatters. + /// No-op - child sinks manage their own formatters. void SetFormatter(std::unique_ptr<Formatter> /*InFormatter*/) override {} void AddSink(SinkPtr InSink) diff --git a/src/zencore/include/zencore/mpscqueue.h b/src/zencore/include/zencore/mpscqueue.h index d97c433fd..38a0bc14f 100644 --- a/src/zencore/include/zencore/mpscqueue.h +++ b/src/zencore/include/zencore/mpscqueue.h @@ -11,7 +11,7 @@ using std::hardware_constructive_interference_size; using std::hardware_destructive_interference_size; #else -// 64 bytes on x86-64 │ L1_CACHE_BYTES │ L1_CACHE_SHIFT │ __cacheline_aligned │ ... +// 64 bytes on x86-64 | L1_CACHE_BYTES | L1_CACHE_SHIFT | __cacheline_aligned | ... constexpr std::size_t hardware_constructive_interference_size = 64; constexpr std::size_t hardware_destructive_interference_size = 64; #endif diff --git a/src/zencore/include/zencore/process.h b/src/zencore/include/zencore/process.h index 19804795b..fd24a6d7d 100644 --- a/src/zencore/include/zencore/process.h +++ b/src/zencore/include/zencore/process.h @@ -34,7 +34,7 @@ public: /// Throws std::system_error on failure. explicit ProcessHandle(int Pid); - /// Construct from an existing native process handle. Takes ownership — + /// Construct from an existing native process handle. Takes ownership - /// the caller must not close the handle afterwards. Windows only. #if ZEN_PLATFORM_WINDOWS explicit ProcessHandle(void* NativeHandle); @@ -56,7 +56,7 @@ public: /// Same as Initialize(int) but reports errors via @p OutEc instead of throwing. void Initialize(int Pid, std::error_code& OutEc); - /// Initialize from an existing native process handle. Takes ownership — + /// Initialize from an existing native process handle. Takes ownership - /// the caller must not close the handle afterwards. Windows only. #if ZEN_PLATFORM_WINDOWS void Initialize(void* ProcessHandle); @@ -195,7 +195,7 @@ struct CreateProcOptions StdoutPipeHandles* StderrPipe = nullptr; // Optional separate pipe for stderr. When null, stderr shares StdoutPipe. /// Additional environment variables for the child process. These are merged - /// with the parent's environment — existing variables are inherited, and + /// with the parent's environment - existing variables are inherited, and /// entries here override or add to them. std::vector<std::pair<std::string, std::string>> Environment; diff --git a/src/zencore/include/zencore/testutils.h b/src/zencore/include/zencore/testutils.h index 2a789d18f..68461deb2 100644 --- a/src/zencore/include/zencore/testutils.h +++ b/src/zencore/include/zencore/testutils.h @@ -62,24 +62,24 @@ struct TrueType namespace utf8test { // 2-byte UTF-8 (Latin extended) - static constexpr const char kLatin[] = u8"café_résumé"; - static constexpr const wchar_t kLatinW[] = L"café_résumé"; + static constexpr const char kLatin[] = u8"caf\xC3\xA9_r\xC3\xA9sum\xC3\xA9"; + static constexpr const wchar_t kLatinW[] = L"caf\u00E9_r\u00E9sum\u00E9"; // 2-byte UTF-8 (Cyrillic) - static constexpr const char kCyrillic[] = u8"данные"; - static constexpr const wchar_t kCyrillicW[] = L"данные"; + static constexpr const char kCyrillic[] = u8"\xD0\xB4\xD0\xB0\xD0\xBD\xD0\xBD\xD1\x8B\xD0\xB5"; + static constexpr const wchar_t kCyrillicW[] = L"\u0434\u0430\u043D\u043D\u044B\u0435"; // 3-byte UTF-8 (CJK) - static constexpr const char kCJK[] = u8"日本語"; - static constexpr const wchar_t kCJKW[] = L"日本語"; + static constexpr const char kCJK[] = u8"\xE6\x97\xA5\xE6\x9C\xAC\xE8\xAA\x9E"; + static constexpr const wchar_t kCJKW[] = L"\u65E5\u672C\u8A9E"; // Mixed scripts - static constexpr const char kMixed[] = u8"zen_éд日"; - static constexpr const wchar_t kMixedW[] = L"zen_éд日"; + static constexpr const char kMixed[] = u8"zen_\xC3\xA9\xD0\xB4\xE6\x97\xA5"; + static constexpr const wchar_t kMixedW[] = L"zen_\u00E9\u0434\u65E5"; - // 4-byte UTF-8 (supplementary plane) — string tests only, NOT filesystem - static constexpr const char kEmoji[] = u8"📦"; - static constexpr const wchar_t kEmojiW[] = L"📦"; + // 4-byte UTF-8 (supplementary plane) - string tests only, NOT filesystem + static constexpr const char kEmoji[] = u8"\xF0\x9F\x93\xA6"; + static constexpr const wchar_t kEmojiW[] = L"\U0001F4E6"; // BMP-only test strings suitable for filesystem use static constexpr const char* kFilenameSafe[] = {kLatin, kCyrillic, kCJK, kMixed}; diff --git a/src/zencore/include/zencore/zencore.h b/src/zencore/include/zencore/zencore.h index a31950b0b..57c7e20fa 100644 --- a/src/zencore/include/zencore/zencore.h +++ b/src/zencore/include/zencore/zencore.h @@ -94,7 +94,7 @@ protected: // With no extra args: ZEN_ASSERT_MSG_("expr") -> "expr" // With a message arg: ZEN_ASSERT_MSG_("expr", "msg") -> "expr" ": " "msg" // With fmt-style args: ZEN_ASSERT_MSG_("expr", "msg", args...) -> "expr" ": " "msg" -// The extra fmt args are silently discarded here — use ZEN_ASSERT_FORMAT for those. +// The extra fmt args are silently discarded here - use ZEN_ASSERT_FORMAT for those. #define ZEN_ASSERT_MSG_SELECT_(_1, _2, N, ...) N #define ZEN_ASSERT_MSG_1_(expr) expr #define ZEN_ASSERT_MSG_2_(expr, msg, ...) expr ": " msg diff --git a/src/zencore/logging.cpp b/src/zencore/logging.cpp index ca34b7d0e..aa95db950 100644 --- a/src/zencore/logging.cpp +++ b/src/zencore/logging.cpp @@ -26,7 +26,7 @@ namespace { // Bootstrap logger: a minimal stdout logger that exists for the entire lifetime // of the process. TheDefaultLogger points here before InitializeLogging() runs // (and is restored here after ShutdownLogging()) so that log macros always have -// a usable target — no null checks or lazy init required on the common path. +// a usable target - no null checks or lazy init required on the common path. zen::Ref<zen::logging::Logger> s_BootstrapLogger = [] { zen::logging::SinkPtr Sink(new zen::logging::AnsiColorStdoutSink()); return zen::Ref<zen::logging::Logger>(new zen::logging::Logger("", Sink)); diff --git a/src/zencore/logging/ansicolorsink.cpp b/src/zencore/logging/ansicolorsink.cpp index 1a8201876..fb127bede 100644 --- a/src/zencore/logging/ansicolorsink.cpp +++ b/src/zencore/logging/ansicolorsink.cpp @@ -205,7 +205,7 @@ IsColorTerminal() // Windows console supports ANSI color by default in modern versions return true; #else - // Unknown terminal — be conservative + // Unknown terminal - be conservative return false; #endif } diff --git a/src/zencore/logging/registry.cpp b/src/zencore/logging/registry.cpp index 383a5d8ba..0f552aced 100644 --- a/src/zencore/logging/registry.cpp +++ b/src/zencore/logging/registry.cpp @@ -137,7 +137,7 @@ struct Registry::Impl { if (Pattern.find_first_of("*?") == std::string::npos) { - // Exact match — fast path via map lookup. + // Exact match - fast path via map lookup. auto It = m_Loggers.find(Pattern); if (It != m_Loggers.end()) { @@ -146,7 +146,7 @@ struct Registry::Impl } else { - // Wildcard pattern — iterate all loggers. + // Wildcard pattern - iterate all loggers. for (auto& [Name, CurLogger] : m_Loggers) { if (MatchLoggerPattern(Pattern, Name)) diff --git a/src/zencore/process.cpp b/src/zencore/process.cpp index aa41c82ff..66062df4d 100644 --- a/src/zencore/process.cpp +++ b/src/zencore/process.cpp @@ -507,7 +507,7 @@ ProcessHandle::Kill() std::error_code Ec; if (!Wait(5000, Ec)) { - // Graceful shutdown timed out — force-kill + // Graceful shutdown timed out - force-kill kill(pid_t(m_Pid), SIGKILL); Wait(1000, Ec); } @@ -1755,7 +1755,7 @@ GetProcessCommandLine(int Pid, std::error_code& OutEc) ++p; // skip null terminator of argv[0] } - // Build result: remaining entries joined by spaces (inter-arg nulls → spaces) + // Build result: remaining entries joined by spaces (inter-arg nulls -> spaces) std::string Result; Result.reserve(static_cast<size_t>(End - p)); for (const char* q = p; q < End; ++q) @@ -2093,7 +2093,7 @@ GetProcessMetrics(const ProcessHandle& Handle, ProcessMetrics& OutMetrics) { Buf[Len] = '\0'; - // Skip past "pid (name) " — find last ')' to handle names containing spaces or parens + // Skip past "pid (name) " - find last ')' to handle names containing spaces or parens const char* P = strrchr(Buf, ')'); if (P) { diff --git a/src/zencore/sentryintegration.cpp b/src/zencore/sentryintegration.cpp index 8491bef64..7e3f33191 100644 --- a/src/zencore/sentryintegration.cpp +++ b/src/zencore/sentryintegration.cpp @@ -250,7 +250,7 @@ SentryIntegration::Initialize(const Config& Conf, const std::string& CommandLine if (SentryOptions == nullptr) { - // OOM — skip sentry entirely rather than crashing on the subsequent set calls + // OOM - skip sentry entirely rather than crashing on the subsequent set calls m_SentryErrorCode = -1; m_IsInitialized = true; return; diff --git a/src/zencore/testing.cpp b/src/zencore/testing.cpp index 9f88a3365..67285dcf1 100644 --- a/src/zencore/testing.cpp +++ b/src/zencore/testing.cpp @@ -39,7 +39,7 @@ PrintCrashCallstack([[maybe_unused]] const char* SignalName) // Use write() + backtrace_symbols_fd() which are async-signal-safe write(STDERR_FILENO, "\n*** Caught ", 12); write(STDERR_FILENO, SignalName, strlen(SignalName)); - write(STDERR_FILENO, " — callstack:\n", 15); + write(STDERR_FILENO, " - callstack:\n", 15); void* Frames[64]; int FrameCount = backtrace(Frames, 64); diff --git a/src/zenhorde/hordeagent.cpp b/src/zenhorde/hordeagent.cpp index 275f5bd4c..41dc8c96c 100644 --- a/src/zenhorde/hordeagent.cpp +++ b/src/zenhorde/hordeagent.cpp @@ -225,7 +225,7 @@ AsyncHordeAgent::DoUploadNext() if (m_CurrentBundleIndex >= m_Config.Bundles.size()) { - // All bundles uploaded — proceed to execute + // All bundles uploaded - proceed to execute m_State = State::Executing; DoExecute(); return; @@ -258,7 +258,7 @@ AsyncHordeAgent::OnUploadResponse(AgentMessageType Type, const uint8_t* Data, si Finish(false); return; } - // Timeout — retry read + // Timeout - retry read auto Self = shared_from_this(); m_ChildChannel->AsyncReadResponse(1000, [this, Self](AgentMessageType Type, const uint8_t* Data, size_t Size) { OnUploadResponse(Type, Data, Size); @@ -268,7 +268,7 @@ AsyncHordeAgent::OnUploadResponse(AgentMessageType Type, const uint8_t* Data, si if (Type == AgentMessageType::WriteFilesResponse) { - // This bundle upload is done — move to next + // This bundle upload is done - move to next ++m_CurrentBundleIndex; DoUploadNext(); return; @@ -391,7 +391,7 @@ AsyncHordeAgent::OnPollResponse(AgentMessageType Type, const uint8_t* Data, size } else { - // Timeout — poll again + // Timeout - poll again DoPoll(); } break; diff --git a/src/zenhorde/hordeagent.h b/src/zenhorde/hordeagent.h index b581a8da1..69b63947b 100644 --- a/src/zenhorde/hordeagent.h +++ b/src/zenhorde/hordeagent.h @@ -46,7 +46,7 @@ struct AsyncAgentConfig /** Async agent that manages the full lifecycle of a single Horde compute connection. * - * Driven by a state machine using callbacks on a shared io_context — no dedicated + * Driven by a state machine using callbacks on a shared io_context - no dedicated * threads. Call Start() to begin the connection/handshake/upload/execute/poll * sequence. The completion handler is invoked when the remote process exits or * an error occurs. diff --git a/src/zenhorde/hordeagentmessage.cpp b/src/zenhorde/hordeagentmessage.cpp index 31498972f..c75cabba8 100644 --- a/src/zenhorde/hordeagentmessage.cpp +++ b/src/zenhorde/hordeagentmessage.cpp @@ -312,7 +312,7 @@ AsyncAgentMessageChannel::AsyncReadResponse(int32_t TimeoutMs, AsyncResponseHand return; } - // No frames queued — store pending handler and arm timeout + // No frames queued - store pending handler and arm timeout m_PendingHandler = std::move(Handler); if (TimeoutMs >= 0) @@ -321,7 +321,7 @@ AsyncAgentMessageChannel::AsyncReadResponse(int32_t TimeoutMs, AsyncResponseHand m_TimeoutTimer->async_wait([this](const asio::error_code& Ec) { if (Ec) { - return; // Cancelled — frame arrived before timeout + return; // Cancelled - frame arrived before timeout } if (m_PendingHandler) diff --git a/src/zenhorde/hordebundle.cpp b/src/zenhorde/hordebundle.cpp index af6b97e59..f89a6bc15 100644 --- a/src/zenhorde/hordebundle.cpp +++ b/src/zenhorde/hordebundle.cpp @@ -48,7 +48,7 @@ static constexpr uint8_t BlobType_DirectoryV1[20] = {0x11, 0xEC, 0x14, 0x07, 0x1 static constexpr size_t BlobTypeSize = 20; -// ─── VarInt helpers (UE format) ───────────────────────────────────────────── +// --- VarInt helpers (UE format) --------------------------------------------- static size_t MeasureVarInt(size_t Value) @@ -76,7 +76,7 @@ WriteVarInt(std::vector<uint8_t>& Buffer, size_t Value) Output[0] = static_cast<uint8_t>((0xFF << (9 - static_cast<int>(ByteCount))) | static_cast<uint8_t>(Value)); } -// ─── Binary helpers ───────────────────────────────────────────────────────── +// --- Binary helpers --------------------------------------------------------- static void WriteLE32(std::vector<uint8_t>& Buffer, int32_t Value) @@ -121,7 +121,7 @@ PatchLE32(std::vector<uint8_t>& Buffer, size_t Offset, int32_t Value) memcpy(Buffer.data() + Offset, &Value, 4); } -// ─── Packet builder ───────────────────────────────────────────────────────── +// --- Packet builder --------------------------------------------------------- // Builds a single uncompressed Horde V2 packet. Layout: // [Signature(3) + Version(1) + PacketLength(4)] 8 bytes (header) @@ -229,7 +229,7 @@ struct PacketBuilder { AlignTo4(Data); - // ── Type table: count(int32) + count * BlobTypeSize bytes ── + // -- Type table: count(int32) + count * BlobTypeSize bytes -- const int32_t TypeTableOffset = static_cast<int32_t>(Data.size()); WriteLE32(Data, static_cast<int32_t>(Types.size())); for (const uint8_t* TypeEntry : Types) @@ -237,12 +237,12 @@ struct PacketBuilder WriteBytes(Data, TypeEntry, BlobTypeSize); } - // ── Import table: count(int32) + (count+1) offsets(int32 each) + import data ── + // -- Import table: count(int32) + (count+1) offsets(int32 each) + import data -- const int32_t ImportTableOffset = static_cast<int32_t>(Data.size()); const int32_t ImportCount = static_cast<int32_t>(Imports.size()); WriteLE32(Data, ImportCount); - // Reserve space for (count+1) offset entries — will be patched below + // Reserve space for (count+1) offset entries - will be patched below const size_t ImportOffsetsStart = Data.size(); for (int32_t i = 0; i <= ImportCount; ++i) { @@ -266,7 +266,7 @@ struct PacketBuilder // Sentinel offset (points past the last import's data) PatchLE32(Data, ImportOffsetsStart + static_cast<size_t>(ImportCount) * 4, static_cast<int32_t>(Data.size())); - // ── Export table: count(int32) + (count+1) offsets(int32 each) ── + // -- Export table: count(int32) + (count+1) offsets(int32 each) -- const int32_t ExportTableOffset = static_cast<int32_t>(Data.size()); const int32_t ExportCount = static_cast<int32_t>(ExportOffsets.size()); WriteLE32(Data, ExportCount); @@ -278,7 +278,7 @@ struct PacketBuilder // Sentinel: points to the start of the type table (end of export data region) WriteLE32(Data, TypeTableOffset); - // ── Patch header ── + // -- Patch header -- // PacketLength = total packet size including the 8-byte header const int32_t PacketLength = static_cast<int32_t>(Data.size()); PatchLE32(Data, 4, PacketLength); @@ -290,7 +290,7 @@ struct PacketBuilder } }; -// ─── Encoded packet wrapper ───────────────────────────────────────────────── +// --- Encoded packet wrapper ------------------------------------------------- // Wraps an uncompressed packet with the encoded header: // [Signature(3) + Version(1) + HeaderLength(4)] 8 bytes @@ -327,7 +327,7 @@ EncodePacket(std::vector<uint8_t> UncompressedPacket) return Encoded; } -// ─── Bundle blob name generation ──────────────────────────────────────────── +// --- Bundle blob name generation -------------------------------------------- static std::string GenerateBlobName() @@ -344,7 +344,7 @@ GenerateBlobName() return std::string(Name.ToView()); } -// ─── File info for bundling ───────────────────────────────────────────────── +// --- File info for bundling ------------------------------------------------- struct FileInfo { @@ -357,7 +357,7 @@ struct FileInfo IoHash RootExportHash; // IoHash of the root export for this file }; -// ─── CreateBundle implementation ──────────────────────────────────────────── +// --- CreateBundle implementation -------------------------------------------- bool BundleCreator::CreateBundle(const std::vector<BundleFile>& Files, const std::filesystem::path& OutputDir, BundleResult& OutResult) @@ -534,7 +534,7 @@ BundleCreator::CreateBundle(const std::vector<BundleFile>& Files, const std::fil FileInfo& Info = ValidFiles[i]; DirImports.push_back(Info.DirectoryExportImportIndex); - // IoHash of target (20 bytes) — import is consumed sequentially from the + // IoHash of target (20 bytes) - import is consumed sequentially from the // export's import list by ReadBlobRef, not encoded in the payload WriteBytes(DirPayload, Info.RootExportHash.Hash, sizeof(IoHash)); // name (string) diff --git a/src/zenhorde/hordecomputesocket.cpp b/src/zenhorde/hordecomputesocket.cpp index 8a6fc40a9..92a56c077 100644 --- a/src/zenhorde/hordecomputesocket.cpp +++ b/src/zenhorde/hordecomputesocket.cpp @@ -182,7 +182,7 @@ AsyncComputeSocket::FlushNextSend() if (Front.Data.empty()) { - // Control frame — header only + // Control frame - header only auto Self = shared_from_this(); m_Transport->AsyncWrite(&Front.Header, sizeof(FrameHeader), @@ -210,7 +210,7 @@ AsyncComputeSocket::FlushNextSend() } else { - // Data frame — write header first, then payload + // Data frame - write header first, then payload auto Self = shared_from_this(); m_Transport->AsyncWrite(&Front.Header, sizeof(FrameHeader), diff --git a/src/zenhorde/hordecomputesocket.h b/src/zenhorde/hordecomputesocket.h index 45b3418b7..b429fd9e3 100644 --- a/src/zenhorde/hordecomputesocket.h +++ b/src/zenhorde/hordecomputesocket.h @@ -36,7 +36,7 @@ using SendHandler = std::function<void(const std::error_code&)>; /** Async multiplexed socket that routes data between channels over a single transport. * - * Uses an async recv pump, a serialized send queue, and a periodic ping timer — + * Uses an async recv pump, a serialized send queue, and a periodic ping timer - * all running on a shared io_context. * * Wire format per frame: [channelId(4B)][size(4B)][data]. diff --git a/src/zenhorde/hordeprovisioner.cpp b/src/zenhorde/hordeprovisioner.cpp index b08544d1a..26b130f6e 100644 --- a/src/zenhorde/hordeprovisioner.cpp +++ b/src/zenhorde/hordeprovisioner.cpp @@ -242,7 +242,7 @@ HordeProvisioner::GetAgentCount() const compute::AgentProvisioningStatus HordeProvisioner::GetAgentStatus(std::string_view WorkerId) const { - // Worker IDs are "horde-{LeaseId}" — strip the prefix to match lease ID + // Worker IDs are "horde-{LeaseId}" - strip the prefix to match lease ID constexpr std::string_view Prefix = "horde-"; if (!WorkerId.starts_with(Prefix)) { diff --git a/src/zenhttp/httpclient.cpp b/src/zenhttp/httpclient.cpp index ace7a3c7f..3da8a9220 100644 --- a/src/zenhttp/httpclient.cpp +++ b/src/zenhttp/httpclient.cpp @@ -520,7 +520,7 @@ MeasureLatency(HttpClient& Client, std::string_view Url) ErrorMessage = MeasureResponse.ErrorMessage(fmt::format("Unable to measure latency using {}", Url)); // Connection-level failures (timeout, refused, DNS) mean the endpoint is unreachable. - // Bail out immediately — retrying will just burn the connect timeout each time. + // Bail out immediately - retrying will just burn the connect timeout each time. if (MeasureResponse.Error && MeasureResponse.Error->IsConnectionError()) { break; diff --git a/src/zenhttp/httpclient_test.cpp b/src/zenhttp/httpclient_test.cpp index 9b3148a4a..67cbaea9b 100644 --- a/src/zenhttp/httpclient_test.cpp +++ b/src/zenhttp/httpclient_test.cpp @@ -1148,7 +1148,7 @@ struct FaultTcpServer ~FaultTcpServer() { // io_context::stop() is thread-safe; do NOT call m_Acceptor.close() from this - // thread — ASIO I/O objects are not safe for concurrent access and the io_context + // thread - ASIO I/O objects are not safe for concurrent access and the io_context // thread may be touching the acceptor in StartAccept(). m_IoContext.stop(); if (m_Thread.joinable()) @@ -1502,7 +1502,7 @@ TEST_CASE("httpclient.transport-faults-post" * doctest::skip()) std::atomic<bool> StallActive{true}; FaultTcpServer Server([&StallActive](asio::ip::tcp::socket& Socket) { DrainHttpRequest(Socket); - // Stop reading body — TCP window will fill and client send will stall + // Stop reading body - TCP window will fill and client send will stall while (StallActive.load()) { std::this_thread::sleep_for(std::chrono::milliseconds(50)); @@ -1739,21 +1739,21 @@ TEST_CASE("httpclient.uri_decoding") TestServerFixture Fixture; HttpClient Client = Fixture.MakeClient(); - // URI without encoding — should pass through unchanged + // URI without encoding - should pass through unchanged { HttpClient::Response Resp = Client.Get("/api/test/echo/uri/hello/world.txt"); REQUIRE(Resp.IsSuccess()); CHECK(Resp.AsText() == "uri=echo/uri/hello/world.txt\ncapture=hello/world.txt"); } - // Percent-encoded space — server should see decoded path + // Percent-encoded space - server should see decoded path { HttpClient::Response Resp = Client.Get("/api/test/echo/uri/hello%20world.txt"); REQUIRE(Resp.IsSuccess()); CHECK(Resp.AsText() == "uri=echo/uri/hello world.txt\ncapture=hello world.txt"); } - // Percent-encoded slash (%2F) — should be decoded to / + // Percent-encoded slash (%2F) - should be decoded to / { HttpClient::Response Resp = Client.Get("/api/test/echo/uri/a%2Fb.txt"); REQUIRE(Resp.IsSuccess()); @@ -1767,21 +1767,21 @@ TEST_CASE("httpclient.uri_decoding") CHECK(Resp.AsText() == "uri=echo/uri/file & name.txt\ncapture=file & name.txt"); } - // No capture — echo/uri route returns just RelativeUri + // No capture - echo/uri route returns just RelativeUri { HttpClient::Response Resp = Client.Get("/api/test/echo/uri"); REQUIRE(Resp.IsSuccess()); CHECK(Resp.AsText() == "echo/uri"); } - // Literal percent that is not an escape (%ZZ) — should be kept as-is + // Literal percent that is not an escape (%ZZ) - should be kept as-is { HttpClient::Response Resp = Client.Get("/api/test/echo/uri/100%25done.txt"); REQUIRE(Resp.IsSuccess()); CHECK(Resp.AsText() == "uri=echo/uri/100%done.txt\ncapture=100%done.txt"); } - // Query params — raw values are returned as-is from GetQueryParams + // Query params - raw values are returned as-is from GetQueryParams { HttpClient::Response Resp = Client.Get("/api/test/echo/uri?key=value&name=test"); REQUIRE(Resp.IsSuccess()); @@ -1792,7 +1792,7 @@ TEST_CASE("httpclient.uri_decoding") { HttpClient::Response Resp = Client.Get("/api/test/echo/uri?prefix=listing%2F&mode=s3"); REQUIRE(Resp.IsSuccess()); - // GetQueryParams returns raw (still-encoded) values — callers must Decode() explicitly + // GetQueryParams returns raw (still-encoded) values - callers must Decode() explicitly CHECK(Resp.AsText() == "echo/uri\nprefix=listing%2F\nmode=s3"); } diff --git a/src/zenhttp/httpserver.cpp b/src/zenhttp/httpserver.cpp index 3668e1e8f..03117ee6c 100644 --- a/src/zenhttp/httpserver.cpp +++ b/src/zenhttp/httpserver.cpp @@ -920,7 +920,7 @@ HttpRequestRouter::HandleRequest(zen::HttpServerRequest& Request) // Strip the separator slash left over after the service prefix is removed. // When a service has BaseUri "/foo", the prefix length is set to len("/foo") = 4. - // Stripping 4 chars from "/foo/bar" yields "/bar" — the path separator becomes + // Stripping 4 chars from "/foo/bar" yields "/bar" - the path separator becomes // the first character of the relative URI. Remove it so patterns like "bar" or // "{id}" match without needing to account for the leading slash. if (!Uri.empty() && Uri.front() == '/') @@ -1621,7 +1621,7 @@ TEST_CASE("http.common") }, HttpVerb::kGet); - // Single-segment literal with leading slash — simulates real server RelativeUri + // Single-segment literal with leading slash - simulates real server RelativeUri { Reset(); TestHttpServerRequest req{Service, "/activity_counters"sv}; @@ -1641,7 +1641,7 @@ TEST_CASE("http.common") CHECK_EQ(Captures[0], "hello"sv); } - // Two-segment route with leading slash — first literal segment + // Two-segment route with leading slash - first literal segment { Reset(); TestHttpServerRequest req{Service, "/prefix/world"sv}; diff --git a/src/zenhttp/include/zenhttp/httpserver.h b/src/zenhttp/include/zenhttp/httpserver.h index 136304426..955b8ed15 100644 --- a/src/zenhttp/include/zenhttp/httpserver.h +++ b/src/zenhttp/include/zenhttp/httpserver.h @@ -302,12 +302,12 @@ public: std::string_view GetDefaultRedirect() const { return m_DefaultRedirect; } - /** Track active WebSocket connections — called by server implementations on upgrade/close. */ + /** Track active WebSocket connections - called by server implementations on upgrade/close. */ void OnWebSocketConnectionOpened() { m_ActiveWebSocketConnections.fetch_add(1, std::memory_order_relaxed); } void OnWebSocketConnectionClosed() { m_ActiveWebSocketConnections.fetch_sub(1, std::memory_order_relaxed); } uint64_t GetActiveWebSocketConnectionCount() const { return m_ActiveWebSocketConnections.load(std::memory_order_relaxed); } - /** Track WebSocket frame and byte counters — called by WS connection implementations per frame. */ + /** Track WebSocket frame and byte counters - called by WS connection implementations per frame. */ void OnWebSocketFrameReceived(uint64_t Bytes) { m_WsFramesReceived.fetch_add(1, std::memory_order_relaxed); @@ -329,7 +329,7 @@ private: int m_EffectiveHttpsPort = 0; std::string m_ExternalHost; metrics::Meter m_RequestMeter; - metrics::HyperLogLog<12> m_ClientAddresses; // ~4 KiB, ~1.6% error — sufficient for client counting + metrics::HyperLogLog<12> m_ClientAddresses; // ~4 KiB, ~1.6% error - sufficient for client counting metrics::HyperLogLog<12> m_ClientSessions; std::string m_DefaultRedirect; std::atomic<uint64_t> m_ActiveWebSocketConnections{0}; diff --git a/src/zenhttp/include/zenhttp/httpstats.h b/src/zenhttp/include/zenhttp/httpstats.h index b20bc3a36..51ab2e06e 100644 --- a/src/zenhttp/include/zenhttp/httpstats.h +++ b/src/zenhttp/include/zenhttp/httpstats.h @@ -23,11 +23,11 @@ namespace zen { class HttpStatsService : public HttpService, public IHttpStatsService, public IWebSocketHandler { public: - /// Construct without an io_context — optionally uses a dedicated push thread + /// Construct without an io_context - optionally uses a dedicated push thread /// for WebSocket stats broadcasting. explicit HttpStatsService(bool EnableWebSockets = false); - /// Construct with an external io_context — uses an asio timer instead + /// Construct with an external io_context - uses an asio timer instead /// of a dedicated thread for WebSocket stats broadcasting. /// The caller must ensure the io_context outlives this service and that /// its run loop is active. diff --git a/src/zenhttp/include/zenhttp/httpwsclient.h b/src/zenhttp/include/zenhttp/httpwsclient.h index 9c3b909a2..fd2f79171 100644 --- a/src/zenhttp/include/zenhttp/httpwsclient.h +++ b/src/zenhttp/include/zenhttp/httpwsclient.h @@ -26,7 +26,7 @@ namespace zen { * Callback interface for WebSocket client events * * Separate from the server-side IWebSocketHandler because the caller - * already owns the HttpWsClient — no Ref<WebSocketConnection> needed. + * already owns the HttpWsClient - no Ref<WebSocketConnection> needed. */ class IWsClientHandler { @@ -85,9 +85,9 @@ private: /// it is treated as a plain host:port and gets the ws:// prefix. /// /// Examples: -/// HttpToWsUrl("http://host:8080", "/orch/ws") → "ws://host:8080/orch/ws" -/// HttpToWsUrl("https://host", "/foo") → "wss://host/foo" -/// HttpToWsUrl("host:8080", "/bar") → "ws://host:8080/bar" +/// HttpToWsUrl("http://host:8080", "/orch/ws") -> "ws://host:8080/orch/ws" +/// HttpToWsUrl("https://host", "/foo") -> "wss://host/foo" +/// HttpToWsUrl("host:8080", "/bar") -> "ws://host:8080/bar" std::string HttpToWsUrl(std::string_view Endpoint, std::string_view Path); } // namespace zen diff --git a/src/zenhttp/servers/httpasio.cpp b/src/zenhttp/servers/httpasio.cpp index cfba3c95f..a1a775ba3 100644 --- a/src/zenhttp/servers/httpasio.cpp +++ b/src/zenhttp/servers/httpasio.cpp @@ -1311,7 +1311,7 @@ HttpServerConnectionT<SocketType>::HandleRequest() return; } } - // Service doesn't support WebSocket or missing key — fall through to normal handling + // Service doesn't support WebSocket or missing key - fall through to normal handling } if (!m_RequestData.IsKeepAlive()) diff --git a/src/zenhttp/servers/httpsys.cpp b/src/zenhttp/servers/httpsys.cpp index d45804c50..67b1230a0 100644 --- a/src/zenhttp/servers/httpsys.cpp +++ b/src/zenhttp/servers/httpsys.cpp @@ -1272,7 +1272,7 @@ HttpSysServer::RegisterHttpUrls(int BasePort) else if (InternalResult == ERROR_SHARING_VIOLATION || InternalResult == ERROR_ACCESS_DENIED) { // Port may be owned by another process's wildcard registration (access denied) - // or actively in use (sharing violation) — retry on a different port + // or actively in use (sharing violation) - retry on a different port ShouldRetryNextPort = true; } else @@ -2638,11 +2638,11 @@ InitialRequestHandler::HandleCompletion(ULONG IoResult, ULONG_PTR NumberOfBytesT ZEN_WARN("WebSocket 101 send failed: {} ({:#x})", GetSystemErrorAsString(SendResult), SendResult); - // WebSocket upgrade failed — return nullptr since ServerRequest() + // WebSocket upgrade failed - return nullptr since ServerRequest() // was never populated (no InvokeRequestHandler call) return nullptr; } - // Service doesn't support WebSocket or missing key — fall through to normal handling + // Service doesn't support WebSocket or missing key - fall through to normal handling } } diff --git a/src/zenhttp/servers/wsasio.cpp b/src/zenhttp/servers/wsasio.cpp index 5ae48f5b3..078c21ea1 100644 --- a/src/zenhttp/servers/wsasio.cpp +++ b/src/zenhttp/servers/wsasio.cpp @@ -141,7 +141,7 @@ WsAsioConnectionT<SocketType>::ProcessReceivedData() } case WebSocketOpcode::kPong: - // Unsolicited pong — ignore per RFC 6455 + // Unsolicited pong - ignore per RFC 6455 break; case WebSocketOpcode::kClose: diff --git a/src/zenhttp/servers/wshttpsys.cpp b/src/zenhttp/servers/wshttpsys.cpp index af320172d..8520e9f60 100644 --- a/src/zenhttp/servers/wshttpsys.cpp +++ b/src/zenhttp/servers/wshttpsys.cpp @@ -70,7 +70,7 @@ WsHttpSysConnection::Shutdown() return; } - // Cancel pending I/O — completions will fire with ERROR_OPERATION_ABORTED + // Cancel pending I/O - completions will fire with ERROR_OPERATION_ABORTED HttpCancelHttpRequest(m_RequestQueueHandle, m_RequestId, nullptr); } @@ -211,7 +211,7 @@ WsHttpSysConnection::ProcessReceivedData() } case WebSocketOpcode::kPong: - // Unsolicited pong — ignore per RFC 6455 + // Unsolicited pong - ignore per RFC 6455 break; case WebSocketOpcode::kClose: @@ -446,7 +446,7 @@ WsHttpSysConnection::DoClose(uint16_t Code, std::string_view Reason) m_Handler.OnWebSocketClose(*this, Code, Reason); - // Cancel pending read I/O — completions drain via ERROR_OPERATION_ABORTED + // Cancel pending read I/O - completions drain via ERROR_OPERATION_ABORTED HttpCancelHttpRequest(m_RequestQueueHandle, m_RequestId, nullptr); } diff --git a/src/zenhttp/servers/wstest.cpp b/src/zenhttp/servers/wstest.cpp index 872698ee5..a58037fec 100644 --- a/src/zenhttp/servers/wstest.cpp +++ b/src/zenhttp/servers/wstest.cpp @@ -60,7 +60,7 @@ TEST_CASE("websocket.framecodec") std::vector<uint8_t> Frame = WsFrameCodec::BuildFrame(WebSocketOpcode::kText, Payload); - // Server frames are unmasked — TryParseFrame should handle them + // Server frames are unmasked - TryParseFrame should handle them WsFrameParseResult Result = WsFrameCodec::TryParseFrame(Frame.data(), Frame.size()); CHECK(Result.IsValid); @@ -130,7 +130,7 @@ TEST_CASE("websocket.framecodec") { std::vector<uint8_t> Frame = WsFrameCodec::BuildFrame(WebSocketOpcode::kText, std::span<const uint8_t>{}); - // Pass only 1 byte — not enough for a frame header + // Pass only 1 byte - not enough for a frame header WsFrameParseResult Result = WsFrameCodec::TryParseFrame(Frame.data(), 1); CHECK_FALSE(Result.IsValid); CHECK_EQ(Result.BytesConsumed, 0u); @@ -465,7 +465,7 @@ namespace { if (!Done.load()) { - // Timeout — cancel the read + // Timeout - cancel the read asio::error_code Ec; Sock.cancel(Ec); } @@ -711,7 +711,7 @@ TEST_CASE("websocket.integration") std::string Response(asio::buffers_begin(ResponseBuf.data()), asio::buffers_end(ResponseBuf.data())); - // Should NOT get 101 — should fall through to normal request handling + // Should NOT get 101 - should fall through to normal request handling CHECK(Response.find("101") == std::string::npos); Sock.close(); diff --git a/src/zenremotestore/chunking/chunkblock.cpp b/src/zenremotestore/chunking/chunkblock.cpp index 0fe3c09ce..8b9d5474a 100644 --- a/src/zenremotestore/chunking/chunkblock.cpp +++ b/src/zenremotestore/chunking/chunkblock.cpp @@ -1214,7 +1214,7 @@ namespace chunkblock_analyser_testutils { // Build a ChunkBlockDescription without any real payload. // Hashes are derived deterministically from (BlockSeed XOR ChunkIndex) so that the same - // seed produces the same hashes — useful for deduplication tests. + // seed produces the same hashes - useful for deduplication tests. static ChunkBlockDescription MakeBlockDesc(uint64_t HeaderSize, std::initializer_list<uint32_t> CompressedLengths, uint32_t BlockSeed = 0) @@ -1257,7 +1257,7 @@ namespace chunkblock_analyser_testutils { TEST_CASE("chunkblock.mergecheapestrange.picks_smallest_gap") { using RD = chunkblock_impl::RangeDescriptor; - // Gap between ranges 0-1 is 50, gap between 1-2 is 150 → pair 0-1 gets merged + // Gap between ranges 0-1 is 50, gap between 1-2 is 150 -> pair 0-1 gets merged std::vector<RD> Ranges = { {.RangeStart = 0, .RangeLength = 100, .ChunkBlockIndexStart = 0, .ChunkBlockIndexCount = 1}, {.RangeStart = 150, .RangeLength = 100, .ChunkBlockIndexStart = 1, .ChunkBlockIndexCount = 1}, @@ -1279,7 +1279,7 @@ TEST_CASE("chunkblock.mergecheapestrange.picks_smallest_gap") TEST_CASE("chunkblock.mergecheapestrange.tiebreak_smaller_merged") { using RD = chunkblock_impl::RangeDescriptor; - // Gap 0-1 == gap 1-2 == 100; merged size 0-1 (250) < merged size 1-2 (350) → pair 0-1 wins + // Gap 0-1 == gap 1-2 == 100; merged size 0-1 (250) < merged size 1-2 (350) -> pair 0-1 wins std::vector<RD> Ranges = { {.RangeStart = 0, .RangeLength = 100, .ChunkBlockIndexStart = 0, .ChunkBlockIndexCount = 1}, {.RangeStart = 200, .RangeLength = 50, .ChunkBlockIndexStart = 1, .ChunkBlockIndexCount = 1}, @@ -1304,7 +1304,7 @@ TEST_CASE("chunkblock.optimizeranges.preserves_ranges_low_latency") { using RD = chunkblock_impl::RangeDescriptor; // With MaxRangeCountPerRequest unlimited, RequestCount=1 - // RequestTimeAsBytes = 100000 * 1 * 0.001 = 100 << slack=7000 → all ranges preserved + // RequestTimeAsBytes = 100000 * 1 * 0.001 = 100 << slack=7000 -> all ranges preserved std::vector<RD> ExactRanges = { {.RangeStart = 0, .RangeLength = 1000, .ChunkBlockIndexStart = 0, .ChunkBlockIndexCount = 1}, {.RangeStart = 2000, .RangeLength = 1000, .ChunkBlockIndexStart = 1, .ChunkBlockIndexCount = 1}, @@ -1325,7 +1325,7 @@ TEST_CASE("chunkblock.optimizeranges.preserves_ranges_low_latency") TEST_CASE("chunkblock.optimizeranges.falls_back_to_full_block") { using RD = chunkblock_impl::RangeDescriptor; - // 1 range already; slack=100 < SpeedBytesPerSec*LatencySec=200 → full block (empty result) + // 1 range already; slack=100 < SpeedBytesPerSec*LatencySec=200 -> full block (empty result) std::vector<RD> ExactRanges = { {.RangeStart = 100, .RangeLength = 900, .ChunkBlockIndexStart = 0, .ChunkBlockIndexCount = 3}, }; @@ -1344,7 +1344,7 @@ TEST_CASE("chunkblock.optimizeranges.falls_back_to_full_block") TEST_CASE("chunkblock.optimizeranges.maxrangesperblock_clamp") { using RD = chunkblock_impl::RangeDescriptor; - // 5 input ranges; MaxRangesPerBlock=2 clamps to ≤2 before the cost model runs + // 5 input ranges; MaxRangesPerBlock=2 clamps to <=2 before the cost model runs std::vector<RD> ExactRanges = { {.RangeStart = 0, .RangeLength = 100, .ChunkBlockIndexStart = 0, .ChunkBlockIndexCount = 1}, {.RangeStart = 300, .RangeLength = 100, .ChunkBlockIndexStart = 1, .ChunkBlockIndexCount = 1}, @@ -1378,8 +1378,8 @@ TEST_CASE("chunkblock.optimizeranges.low_maxrangecountperrequest_drives_merge") uint64_t TotalBlockSize = 1000; double LatencySec = 1.0; uint64_t SpeedBytesPerSec = 500; - // With MaxRangeCountPerRequest=-1: RequestCount=1, RequestTimeAsBytes=500 < slack=700 → preserved - // With MaxRangeCountPerRequest=1: RequestCount=3, RequestTimeAsBytes=1500 > slack=700 → merged + // With MaxRangeCountPerRequest=-1: RequestCount=1, RequestTimeAsBytes=500 < slack=700 -> preserved + // With MaxRangeCountPerRequest=1: RequestCount=3, RequestTimeAsBytes=1500 > slack=700 -> merged uint64_t MaxRangesPerBlock = 1024; auto Unlimited = @@ -1394,7 +1394,7 @@ TEST_CASE("chunkblock.optimizeranges.low_maxrangecountperrequest_drives_merge") TEST_CASE("chunkblock.optimizeranges.unlimited_rangecountperrequest_no_extra_cost") { using RD = chunkblock_impl::RangeDescriptor; - // MaxRangeCountPerRequest=-1 → RequestCount always 1, even with many ranges and high latency + // MaxRangeCountPerRequest=-1 -> RequestCount always 1, even with many ranges and high latency std::vector<RD> ExactRanges = { {.RangeStart = 0, .RangeLength = 50, .ChunkBlockIndexStart = 0, .ChunkBlockIndexCount = 1}, {.RangeStart = 200, .RangeLength = 50, .ChunkBlockIndexStart = 1, .ChunkBlockIndexCount = 1}, @@ -1418,7 +1418,7 @@ TEST_CASE("chunkblock.optimizeranges.two_range_direct_merge_path") { using RD = chunkblock_impl::RangeDescriptor; // Exactly 2 ranges; cost model demands merge; exercises the RangeCount==2 direct-merge branch - // After direct merge → 1 range with small slack → full block (empty) + // After direct merge -> 1 range with small slack -> full block (empty) std::vector<RD> ExactRanges = { {.RangeStart = 0, .RangeLength = 100, .ChunkBlockIndexStart = 0, .ChunkBlockIndexCount = 2}, {.RangeStart = 400, .RangeLength = 100, .ChunkBlockIndexStart = 2, .ChunkBlockIndexCount = 2}, @@ -1429,8 +1429,8 @@ TEST_CASE("chunkblock.optimizeranges.two_range_direct_merge_path") uint64_t MaxRangeCountPerReq = (uint64_t)-1; uint64_t MaxRangesPerBlock = 1024; - // Iteration 1: RangeCount=2, RequestCount=1, RequestTimeAsBytes=500 > slack=400 → direct merge - // After merge: 1 range [{0,500,0,4}], slack=100 < Speed*Lat=500 → full block + // Iteration 1: RangeCount=2, RequestCount=1, RequestTimeAsBytes=500 > slack=400 -> direct merge + // After merge: 1 range [{0,500,0,4}], slack=100 < Speed*Lat=500 -> full block auto Result = chunkblock_impl::OptimizeRanges(TotalBlockSize, ExactRanges, LatencySec, SpeedBytesPerSec, MaxRangeCountPerReq, MaxRangesPerBlock); @@ -1506,9 +1506,9 @@ TEST_CASE("chunkblock.getneeded.dedup_low_slack_wins") LoggerRef LogRef = Log(); std::unique_ptr<OperationLogOutput> LogOutput(CreateStandardLogOutput(LogRef)); - // Block 0: {H0, H1, SharedH, H3} — 3 of 4 needed (H3 not needed); slack = 100 - // Block 1: {H4, H5, SharedH, H6} — only SharedH needed; slack = 300 - // Block 0 has less slack → processed first → SharedH assigned to block 0 + // Block 0: {H0, H1, SharedH, H3} - 3 of 4 needed (H3 not needed); slack = 100 + // Block 1: {H4, H5, SharedH, H6} - only SharedH needed; slack = 300 + // Block 0 has less slack -> processed first -> SharedH assigned to block 0 IoHash SharedH = IoHash::HashBuffer(MemoryView("shared_chunk_dedup", 18)); IoHash H0 = IoHash::HashBuffer(MemoryView("block0_chunk0", 13)); IoHash H1 = IoHash::HashBuffer(MemoryView("block0_chunk1", 13)); @@ -1533,7 +1533,7 @@ TEST_CASE("chunkblock.getneeded.dedup_low_slack_wins") ChunkBlockAnalyser::Options Options; ChunkBlockAnalyser Analyser(*LogOutput, Blocks, Options); - // Map: H0→0, H1→1, SharedH→2, H3→3, H4→4, H5→5, H6→6 + // Map: H0->0, H1->1, SharedH->2, H3->3, H4->4, H5->5, H6->6 auto HashMap = MakeHashMap(Blocks); // Need H0(0), H1(1), SharedH(2) from block 0; SharedH from block 1 (already index 2) // H3(3) not needed; H4,H5,H6 not needed @@ -1541,7 +1541,7 @@ TEST_CASE("chunkblock.getneeded.dedup_low_slack_wins") // Block 0 slack=100 (H3 unused), block 1 slack=300 (H4,H5,H6 unused) // Block 0 processed first; picks up H0, H1, SharedH - // Block 1 tries SharedH but it's already picked up → empty → not added + // Block 1 tries SharedH but it's already picked up -> empty -> not added REQUIRE_EQ(1u, NeededBlocks.size()); CHECK_EQ(0u, NeededBlocks[0].BlockIndex); REQUIRE_EQ(3u, NeededBlocks[0].ChunkIndexes.size()); @@ -1580,14 +1580,14 @@ TEST_CASE("chunkblock.getneeded.dedup_no_double_pickup") ChunkBlockAnalyser::Options Options; ChunkBlockAnalyser Analyser(*LogOutput, Blocks, Options); - // Map: SharedH→0, H0→1, H1→2, H2→3, H3→4 + // Map: SharedH->0, H0->1, H1->2, H2->3, H3->4 // Only SharedH (index 0) needed; no other chunks auto HashMap = MakeHashMap(Blocks); auto NeededBlocks = Analyser.GetNeeded(HashMap, [](uint32_t ChunkIndex) { return ChunkIndex == 0; }); - // Block 0: SharedH needed, H0 not needed → slack=100 - // Block 1: SharedH needed, H1/H2/H3 not needed → slack=300 - // Block 0 processed first → picks up SharedH; Block 1 skips it + // Block 0: SharedH needed, H0 not needed -> slack=100 + // Block 1: SharedH needed, H1/H2/H3 not needed -> slack=300 + // Block 0 processed first -> picks up SharedH; Block 1 skips it // Count total occurrences of SharedH across all NeededBlocks uint32_t SharedOccurrences = 0; @@ -1612,7 +1612,7 @@ TEST_CASE("chunkblock.getneeded.skips_unrequested_chunks") LoggerRef LogRef = Log(); std::unique_ptr<OperationLogOutput> LogOutput(CreateStandardLogOutput(LogRef)); - // Block has 4 chunks but only 2 appear in the hash map → ChunkIndexes has exactly those 2 + // Block has 4 chunks but only 2 appear in the hash map -> ChunkIndexes has exactly those 2 auto Block = MakeBlockDesc(50, {100, 100, 100, 100}); ChunkBlockAnalyser::Options Options; ChunkBlockAnalyser Analyser(*LogOutput, std::span<const ChunkBlockDescription>(&Block, 1), Options); @@ -1639,7 +1639,7 @@ TEST_CASE("chunkblock.getneeded.two_blocks_both_contribute") std::unique_ptr<OperationLogOutput> LogOutput(CreateStandardLogOutput(LogRef)); // Block 0: all 4 needed (slack=0); block 1: 3 of 4 needed (slack=100) - // Both blocks contribute chunks → 2 NeededBlocks in result + // Both blocks contribute chunks -> 2 NeededBlocks in result auto Block0 = MakeBlockDesc(50, {100, 100, 100, 100}, /*BlockSeed=*/0); auto Block1 = MakeBlockDesc(50, {100, 100, 100, 100}, /*BlockSeed=*/200); @@ -1647,7 +1647,7 @@ TEST_CASE("chunkblock.getneeded.two_blocks_both_contribute") ChunkBlockAnalyser::Options Options; ChunkBlockAnalyser Analyser(*LogOutput, Blocks, Options); - // HashMap: Block0 hashes → indices 0-3, Block1 hashes → indices 4-7 + // HashMap: Block0 hashes -> indices 0-3, Block1 hashes -> indices 4-7 auto HashMap = MakeHashMap(Blocks); // Need all Block0 chunks (0-3) and Block1 chunks 0-2 (indices 4-6); not chunk index 7 (Block1 chunk 3) auto NeededBlocks = Analyser.GetNeeded(HashMap, [](uint32_t ChunkIndex) { return ChunkIndex <= 6; }); @@ -1669,7 +1669,7 @@ TEST_CASE("chunkblock.calc.off_mode") LoggerRef LogRef = Log(); std::unique_ptr<OperationLogOutput> LogOutput(CreateStandardLogOutput(LogRef)); - // HeaderSize > 0, chunks size matches → CanDoPartialBlockDownload = true + // HeaderSize > 0, chunks size matches -> CanDoPartialBlockDownload = true // But mode Off forces full block regardless auto Block = MakeBlockDesc(50, {100, 200, 300, 400}); ChunkBlockAnalyser::Options Options; @@ -1701,7 +1701,7 @@ TEST_CASE("chunkblock.calc.exact_mode") uint64_t ChunkStartOffset = CompressedBuffer::GetHeaderSizeForNoneEncoder() + Block.HeaderSize; - // Need chunks 0 and 2 → 2 non-contiguous ranges; Exact mode passes them straight through + // Need chunks 0 and 2 -> 2 non-contiguous ranges; Exact mode passes them straight through std::vector<ChunkBlockAnalyser::NeededBlock> NeededBlocks = {{.BlockIndex = 0, .ChunkIndexes = {0, 2}}}; std::vector<Mode> Modes = {Mode::Exact}; @@ -1732,14 +1732,14 @@ TEST_CASE("chunkblock.calc.singlerange_mode") std::unique_ptr<OperationLogOutput> LogOutput(CreateStandardLogOutput(LogRef)); auto Block = MakeBlockDesc(50, {100, 200, 300, 400}); - // Default HostLatencySec=-1 → OptimizeRanges not called after SingleRange collapse + // Default HostLatencySec=-1 -> OptimizeRanges not called after SingleRange collapse ChunkBlockAnalyser::Options Options; Options.IsQuiet = true; ChunkBlockAnalyser Analyser(*LogOutput, std::span<const ChunkBlockDescription>(&Block, 1), Options); uint64_t ChunkStartOffset = CompressedBuffer::GetHeaderSizeForNoneEncoder() + Block.HeaderSize; - // Need chunks 0 and 2 → 2 ranges that get collapsed to 1 + // Need chunks 0 and 2 -> 2 ranges that get collapsed to 1 std::vector<ChunkBlockAnalyser::NeededBlock> NeededBlocks = {{.BlockIndex = 0, .ChunkIndexes = {0, 2}}}; std::vector<Mode> Modes = {Mode::SingleRange}; @@ -1765,7 +1765,7 @@ TEST_CASE("chunkblock.calc.multirange_mode") std::unique_ptr<OperationLogOutput> LogOutput(CreateStandardLogOutput(LogRef)); auto Block = MakeBlockDesc(50, {100, 200, 300, 400}); - // Low latency: RequestTimeAsBytes=100 << slack → OptimizeRanges preserves ranges + // Low latency: RequestTimeAsBytes=100 << slack -> OptimizeRanges preserves ranges ChunkBlockAnalyser::Options Options; Options.IsQuiet = true; Options.HostLatencySec = 0.001; @@ -1796,8 +1796,8 @@ TEST_CASE("chunkblock.calc.multirangehighspeed_mode") std::unique_ptr<OperationLogOutput> LogOutput(CreateStandardLogOutput(LogRef)); auto Block = MakeBlockDesc(50, {100, 200, 300, 400}); - // Block slack ≈ 714 bytes (TotalBlockSize≈1114, RangeTotalSize=400 for chunks 0+2) - // RequestTimeAsBytes = 400000 * 1 * 0.001 = 400 < 714 → ranges preserved + // Block slack ~= 714 bytes (TotalBlockSize~=1114, RangeTotalSize=400 for chunks 0+2) + // RequestTimeAsBytes = 400000 * 1 * 0.001 = 400 < 714 -> ranges preserved ChunkBlockAnalyser::Options Options; Options.IsQuiet = true; Options.HostHighSpeedLatencySec = 0.001; @@ -1834,7 +1834,7 @@ TEST_CASE("chunkblock.calc.all_chunks_needed_full_block") Options.HostSpeedBytesPerSec = 100000; ChunkBlockAnalyser Analyser(*LogOutput, std::span<const ChunkBlockDescription>(&Block, 1), Options); - // All 4 chunks needed → short-circuit to full block regardless of mode + // All 4 chunks needed -> short-circuit to full block regardless of mode std::vector<ChunkBlockAnalyser::NeededBlock> NeededBlocks = {{.BlockIndex = 0, .ChunkIndexes = {0, 1, 2, 3}}}; std::vector<Mode> Modes = {Mode::Exact}; @@ -1853,7 +1853,7 @@ TEST_CASE("chunkblock.calc.headersize_zero_forces_full_block") LoggerRef LogRef = Log(); std::unique_ptr<OperationLogOutput> LogOutput(CreateStandardLogOutput(LogRef)); - // HeaderSize=0 → CanDoPartialBlockDownload=false → full block even in Exact mode + // HeaderSize=0 -> CanDoPartialBlockDownload=false -> full block even in Exact mode auto Block = MakeBlockDesc(0, {100, 200, 300, 400}); ChunkBlockAnalyser::Options Options; Options.IsQuiet = true; @@ -1877,8 +1877,8 @@ TEST_CASE("chunkblock.calc.low_maxrangecountperrequest") LoggerRef LogRef = Log(); std::unique_ptr<OperationLogOutput> LogOutput(CreateStandardLogOutput(LogRef)); - // 5 chunks of 100 bytes each; need chunks 0, 2, 4 → 3 non-contiguous ranges - // With MaxRangeCountPerRequest=1 and high latency, cost model merges aggressively → full block + // 5 chunks of 100 bytes each; need chunks 0, 2, 4 -> 3 non-contiguous ranges + // With MaxRangeCountPerRequest=1 and high latency, cost model merges aggressively -> full block auto Block = MakeBlockDesc(10, {100, 100, 100, 100, 100}); ChunkBlockAnalyser::Options Options; Options.IsQuiet = true; @@ -1892,7 +1892,7 @@ TEST_CASE("chunkblock.calc.low_maxrangecountperrequest") auto Result = Analyser.CalculatePartialBlockDownloads(NeededBlocks, Modes); - // Cost model drives merging: 3 requests × 1000 × 0.1 = 300 > slack ≈ 210+headersize + // Cost model drives merging: 3 requests x 1000 x 0.1 = 300 > slack ~= 210+headersize // After merges converges to full block REQUIRE_EQ(1u, Result.FullBlockIndexes.size()); CHECK_EQ(0u, Result.FullBlockIndexes[0]); @@ -1908,7 +1908,7 @@ TEST_CASE("chunkblock.calc.no_latency_skips_optimize") std::unique_ptr<OperationLogOutput> LogOutput(CreateStandardLogOutput(LogRef)); auto Block = MakeBlockDesc(50, {100, 200, 300, 400}); - // Default HostLatencySec=-1 → OptimizeRanges not called; raw GetBlockRanges result used + // Default HostLatencySec=-1 -> OptimizeRanges not called; raw GetBlockRanges result used ChunkBlockAnalyser::Options Options; Options.IsQuiet = true; ChunkBlockAnalyser Analyser(*LogOutput, std::span<const ChunkBlockDescription>(&Block, 1), Options); @@ -1920,7 +1920,7 @@ TEST_CASE("chunkblock.calc.no_latency_skips_optimize") auto Result = Analyser.CalculatePartialBlockDownloads(NeededBlocks, Modes); - // No optimize pass → exact ranges from GetBlockRanges + // No optimize pass -> exact ranges from GetBlockRanges CHECK(Result.FullBlockIndexes.empty()); REQUIRE_EQ(2u, Result.BlockRanges.size()); CHECK_EQ(ChunkStartOffset, Result.BlockRanges[0].RangeStart); @@ -1961,11 +1961,11 @@ TEST_CASE("chunkblock.calc.multiple_blocks_different_modes") auto Result = Analyser.CalculatePartialBlockDownloads(NeededBlocks, Modes); - // Block 0: Off → FullBlockIndexes + // Block 0: Off -> FullBlockIndexes REQUIRE_EQ(1u, Result.FullBlockIndexes.size()); CHECK_EQ(0u, Result.FullBlockIndexes[0]); - // Block 1: Exact → 2 ranges; Block 2: MultiRange (low latency) → 2 ranges + // Block 1: Exact -> 2 ranges; Block 2: MultiRange (low latency) -> 2 ranges // Total: 4 ranges REQUIRE_EQ(4u, Result.BlockRanges.size()); @@ -2058,7 +2058,7 @@ TEST_CASE("chunkblock.getblockranges.non_contiguous") { using namespace chunkblock_analyser_testutils; - // Chunks 0 and 2 needed, chunk 1 skipped → two separate ranges + // Chunks 0 and 2 needed, chunk 1 skipped -> two separate ranges auto Block = MakeBlockDesc(50, {100, 200, 300}); uint64_t ChunkStartOffset = CompressedBuffer::GetHeaderSizeForNoneEncoder() + Block.HeaderSize; @@ -2082,7 +2082,7 @@ TEST_CASE("chunkblock.getblockranges.contiguous_run") { using namespace chunkblock_analyser_testutils; - // Chunks 1, 2, 3 needed (consecutive) → one merged range + // Chunks 1, 2, 3 needed (consecutive) -> one merged range auto Block = MakeBlockDesc(50, {50, 100, 150, 200, 250}); uint64_t ChunkStartOffset = CompressedBuffer::GetHeaderSizeForNoneEncoder() + Block.HeaderSize; diff --git a/src/zenserver-test/compute-tests.cpp b/src/zenserver-test/compute-tests.cpp index ce2db366a..a4755adec 100644 --- a/src/zenserver-test/compute-tests.cpp +++ b/src/zenserver-test/compute-tests.cpp @@ -698,7 +698,7 @@ TEST_CASE("function.workers") const IoHash WorkerId = RegisterWorker(Client, TestEnv); - // GET /workers — the registered worker should appear in the listing + // GET /workers - the registered worker should appear in the listing HttpClient::Response ListResp = Client.Get("/workers"sv); REQUIRE_MESSAGE(ListResp, "Failed to list workers after registration"); @@ -714,7 +714,7 @@ TEST_CASE("function.workers") REQUIRE_MESSAGE(WorkerFound, fmt::format("Worker {} not found in worker listing", WorkerId.ToHexString())); - // GET /workers/{worker} — descriptor should match what was registered + // GET /workers/{worker} - descriptor should match what was registered const std::string WorkerUrl = fmt::format("/workers/{}", WorkerId.ToHexString()); HttpClient::Response DescResp = Client.Get(WorkerUrl); REQUIRE_MESSAGE(DescResp, fmt::format("Failed to get worker descriptor: status={}", DescResp.StatusCode)); @@ -743,7 +743,7 @@ TEST_CASE("function.workers") CHECK_MESSAGE(Rot13Found, "Rot13 function not found in worker descriptor"); CHECK_MESSAGE(SleepFound, "Sleep function not found in worker descriptor"); - // GET /workers/{unknown} — should return 404 + // GET /workers/{unknown} - should return 404 const std::string UnknownUrl = fmt::format("/workers/{}", IoHash::Zero.ToHexString()); HttpClient::Response NotFoundResp = Client.Get(UnknownUrl); CHECK_EQ(NotFoundResp.StatusCode, HttpResponseCode::NotFound); @@ -874,7 +874,7 @@ TEST_CASE("function.queues.remote") const IoHash WorkerId = RegisterWorker(Client, TestEnv); - // Create a remote queue — response includes both an integer queue_id and an OID queue_token + // Create a remote queue - response includes both an integer queue_id and an OID queue_token HttpClient::Response CreateResp = Client.Post("/queues/remote"sv); REQUIRE_MESSAGE(CreateResp, fmt::format("Remote queue creation failed: status={}, body={}", CreateResp.StatusCode, CreateResp.ToText())); @@ -1114,7 +1114,7 @@ TEST_CASE("function.priority") REQUIRE_MESSAGE(LowResp3, "Low-priority job 3 submission failed"); const int LsnLow3 = LowResp3.AsObject()["lsn"sv].AsInt32(); - // Submit 1 high-priority Rot13 job — should execute before the low-priority ones + // Submit 1 high-priority Rot13 job - should execute before the low-priority ones const std::string HighJobUrl = fmt::format("/queues/{}/jobs/{}?priority=10", QueueId, WorkerId.ToHexString()); HttpClient::Response HighResp = Client.Post(HighJobUrl, BuildRot13ActionPackage("high"sv)); REQUIRE_MESSAGE(HighResp, "High-priority job submission failed"); @@ -1699,7 +1699,7 @@ TEST_CASE("function.remote.late_runner_discovery") } REQUIRE_MESSAGE(WorkerFound, - fmt::format("Worker not found on W2 after discovery — SyncWorkersToRunner may have failed\nW2 log:\n{}", + fmt::format("Worker not found on W2 after discovery - SyncWorkersToRunner may have failed\nW2 log:\n{}", Instance2.GetLogOutput())); } @@ -1851,7 +1851,7 @@ TEST_CASE("function.remote.queue_cancel_propagation") // Wait for the action to start running on the remote WaitForActionRunning(Session); - // Cancel the local queue — this should propagate to the remote + // Cancel the local queue - this should propagate to the remote Session.CancelQueue(QueueId); // Poll for the action to complete (as cancelled) @@ -1975,7 +1975,7 @@ TEST_CASE("function.session.abandon_pending" * doctest::skip()) CbPackage WorkerPackage = BuildWorkerPackage(TestEnv, Resolver); Session.RegisterWorker(WorkerPackage); - // Enqueue several actions — they will stay pending because there are no runners + // Enqueue several actions - they will stay pending because there are no runners auto QueueResult = Session.CreateQueue(); REQUIRE_MESSAGE(QueueResult.QueueId != 0, "Failed to create queue"); @@ -1988,7 +1988,7 @@ TEST_CASE("function.session.abandon_pending" * doctest::skip()) REQUIRE_MESSAGE(Enqueue2, "Failed to enqueue action 2"); REQUIRE_MESSAGE(Enqueue3, "Failed to enqueue action 3"); - // Transition to Abandoned — should mark all pending actions as Abandoned + // Transition to Abandoned - should mark all pending actions as Abandoned bool Transitioned = Session.Abandon(); CHECK_MESSAGE(Transitioned, "Failed to transition to Abandoned"); CHECK(Session.GetSessionState() == zen::compute::ComputeServiceSession::SessionState::Abandoned); @@ -2024,7 +2024,7 @@ TEST_CASE("function.session.abandon_pending" * doctest::skip()) auto Rejected = Session.EnqueueActionToQueue(QueueResult.QueueId, ActionObj, 0); CHECK_MESSAGE(!Rejected, "Expected action submission to be rejected in Abandoned state"); - // Abandoned → Sunset should be valid + // Abandoned -> Sunset should be valid CHECK(Session.RequestStateTransition(zen::compute::ComputeServiceSession::SessionState::Sunset)); Session.Shutdown(); @@ -2067,7 +2067,7 @@ TEST_CASE("function.session.abandon_running") // Wait for the action to start running on the remote WaitForActionRunning(Session); - // Transition to Abandoned — should abandon the running action + // Transition to Abandoned - should abandon the running action bool Transitioned = Session.Abandon(); CHECK_MESSAGE(Transitioned, "Failed to transition to Abandoned"); CHECK(!Session.IsHealthy()); @@ -2137,7 +2137,7 @@ TEST_CASE("function.remote.abandon_propagation") // Wait for the action to start running on the remote WaitForActionRunning(Session); - // Transition to Abandoned — should abandon the running action and propagate + // Transition to Abandoned - should abandon the running action and propagate bool Transitioned = Session.Abandon(); CHECK_MESSAGE(Transitioned, "Failed to transition to Abandoned"); @@ -2227,7 +2227,7 @@ TEST_CASE("function.remote.shutdown_cancels_queues") REQUIRE_MESSAGE(RemoteQueueFound, "Expected remote queue to exist before shutdown"); } - // Shut down the session — this should cancel all remote queues + // Shut down the session - this should cancel all remote queues Session.Shutdown(); // Verify the remote queue is now cancelled @@ -2296,7 +2296,7 @@ TEST_CASE("function.remote.shutdown_rejects_new_work") CHECK_EQ(GetRot13Output(ResultPackage), "Uryyb Jbeyq"sv); } - // Shut down — the remote runner should now reject new work + // Shut down - the remote runner should now reject new work Session.Shutdown(); // Attempting to enqueue after shutdown should fail (session is in Sunset state) @@ -2386,7 +2386,7 @@ TEST_CASE("function.session.retract_not_terminal") REQUIRE_MESSAGE(Code == HttpResponseCode::OK, "Action did not complete within timeout"); - // Retract should fail — action already completed (no longer in pending/running maps) + // Retract should fail - action already completed (no longer in pending/running maps) auto RetractResult = Session.RetractAction(Enqueued.Lsn); CHECK(!RetractResult.Success); @@ -2412,7 +2412,7 @@ TEST_CASE("function.retract_http") HttpClient::Response BlockerResp = Client.Post(BlockerUrl, BuildSleepActionPackage("data"sv, 30'000)); REQUIRE_MESSAGE(BlockerResp, fmt::format("Blocker submission failed: status={}", BlockerResp.StatusCode)); - // Submit a second action — it will stay pending because the slot is occupied + // Submit a second action - it will stay pending because the slot is occupied HttpClient::Response SubmitResp = Client.Post(BlockerUrl, BuildRot13ActionPackage("Retract HTTP Test"sv)); REQUIRE_MESSAGE(SubmitResp, fmt::format("Job submission failed: status={}", SubmitResp.StatusCode)); @@ -2464,13 +2464,13 @@ TEST_CASE("function.session.immediate_query_after_enqueue") auto EnqueueRes = Session.EnqueueAction(ActionObj, 0); REQUIRE_MESSAGE(EnqueueRes, "Failed to enqueue action"); - // Query by LSN immediately — must not return NotFound + // Query by LSN immediately - must not return NotFound CbPackage Result; HttpResponseCode Code = Session.GetActionResult(EnqueueRes.Lsn, Result); CHECK_MESSAGE(Code == HttpResponseCode::Accepted, fmt::format("GetActionResult returned {} immediately after enqueue, expected Accepted", Code)); - // Query by ActionId immediately — must not return NotFound + // Query by ActionId immediately - must not return NotFound const IoHash ActionId = ActionObj.GetHash(); CbPackage FindResult; HttpResponseCode FindCode = Session.FindActionResult(ActionId, FindResult); diff --git a/src/zenserver-test/logging-tests.cpp b/src/zenserver-test/logging-tests.cpp index 549d2b322..cb0926ddc 100644 --- a/src/zenserver-test/logging-tests.cpp +++ b/src/zenserver-test/logging-tests.cpp @@ -69,8 +69,8 @@ TEST_CASE("logging.file.default") // --quiet sets the console sink level to WARN. The formatted "[info] ..." // entry written by the default logger's console sink must therefore not appear -// in captured stdout. (The "console" named logger — used by ZEN_CONSOLE_* -// macros — may still emit plain-text messages without a level marker, so we +// in captured stdout. (The "console" named logger - used by ZEN_CONSOLE_* +// macros - may still emit plain-text messages without a level marker, so we // check for the absence of the FullFormatter "[info]" prefix rather than the // message text itself.) TEST_CASE("logging.console.quiet") diff --git a/src/zenserver-test/process-tests.cpp b/src/zenserver-test/process-tests.cpp index ae11bb294..3f6476810 100644 --- a/src/zenserver-test/process-tests.cpp +++ b/src/zenserver-test/process-tests.cpp @@ -115,7 +115,7 @@ TEST_CASE("pipe.raii_cleanup") { StdoutPipeHandles Pipe; REQUIRE(CreateStdoutPipe(Pipe)); - // Pipe goes out of scope here — destructor should close both ends + // Pipe goes out of scope here - destructor should close both ends } } @@ -155,7 +155,7 @@ TEST_CASE("pipe.move_semantics") CHECK(Moved.WriteFd == -1); # endif - // Assigned goes out of scope — destructor closes handles + // Assigned goes out of scope - destructor closes handles } TEST_CASE("pipe.close_is_idempotent") diff --git a/src/zenserver/compute/computeserver.cpp b/src/zenserver/compute/computeserver.cpp index 8cd8b4cfe..f35fe0f97 100644 --- a/src/zenserver/compute/computeserver.cpp +++ b/src/zenserver/compute/computeserver.cpp @@ -456,13 +456,13 @@ ZenComputeServer::Cleanup() m_OrchestratorService->SetProvisionerStateProvider(nullptr); } - // Shut down Horde provisioner — this signals all agent threads + // Shut down Horde provisioner - this signals all agent threads // to exit and joins them before we tear down HTTP services. m_HordeProvisioner.reset(); # endif # if ZEN_WITH_NOMAD - // Shut down Nomad provisioner — stops the management thread and + // Shut down Nomad provisioner - stops the management thread and // sends stop requests for all tracked jobs. m_NomadProvisioner.reset(); # endif @@ -989,7 +989,7 @@ ZenComputeServer::Run() InitializeOrchestratorWebSocket(); # if ZEN_WITH_HORDE - // Start Horde provisioning if configured — request maximum allowed cores. + // Start Horde provisioning if configured - request maximum allowed cores. // SetTargetCoreCount clamps to HordeConfig::MaxCores internally. if (m_HordeProvisioner) { @@ -1001,7 +1001,7 @@ ZenComputeServer::Run() # endif # if ZEN_WITH_NOMAD - // Start Nomad provisioning if configured — request maximum allowed cores. + // Start Nomad provisioning if configured - request maximum allowed cores. // SetTargetCoreCount clamps to NomadConfig::MaxCores internally. if (m_NomadProvisioner) { diff --git a/src/zenserver/compute/computeserver.h b/src/zenserver/compute/computeserver.h index 63db7e9b3..aa9c1a5b3 100644 --- a/src/zenserver/compute/computeserver.h +++ b/src/zenserver/compute/computeserver.h @@ -53,7 +53,7 @@ struct ZenComputeServerConfig : public ZenServerConfig std::string AnnounceUrl; ///< Override for self-announced URL (e.g. relay-visible endpoint) std::string IdmsEndpoint; int32_t MaxConcurrentActions = 0; // 0 = auto (LogicalProcessorCount * 2) - bool EnableWorkerWebSocket = false; // Use WebSocket for worker↔orchestrator link + bool EnableWorkerWebSocket = false; // Use WebSocket for worker<->orchestrator link bool ProvisionClean = false; // Pass --clean to provisioned workers std::string ProvisionTraceHost; // Pass --tracehost to provisioned workers @@ -171,7 +171,7 @@ private: std::string GetInstanceId() const; CbObject BuildAnnounceBody(); - // Worker→orchestrator WebSocket client + // Worker->orchestrator WebSocket client struct OrchestratorWsHandler : public IWsClientHandler { ZenComputeServer& Server; diff --git a/src/zenserver/frontend/frontend.cpp b/src/zenserver/frontend/frontend.cpp index 52ec5b8b3..812536074 100644 --- a/src/zenserver/frontend/frontend.cpp +++ b/src/zenserver/frontend/frontend.cpp @@ -160,7 +160,7 @@ HttpFrontendService::HandleRequest(zen::HttpServerRequest& Request) ContentType = ParseContentType(DotExt); - // Extensions used only for static file serving — not in the global + // Extensions used only for static file serving - not in the global // ParseContentType table because that table also drives URI extension // stripping for content negotiation, and we don't want /api/foo.txt to // have its extension removed. diff --git a/src/zenserver/frontend/zipfs.cpp b/src/zenserver/frontend/zipfs.cpp index c7c8687ca..27b92f33a 100644 --- a/src/zenserver/frontend/zipfs.cpp +++ b/src/zenserver/frontend/zipfs.cpp @@ -189,12 +189,12 @@ ZipFs::GetFile(const std::string_view& FileName) const if (Item.CompressionMethod == 0) { - // Stored — point directly into the buffer + // Stored - point directly into the buffer Item.View = MemoryView(FileData, Item.UncompressedSize); } else { - // Deflate — decompress using zlib + // Deflate - decompress using zlib Item.DecompressedData = IoBuffer(Item.UncompressedSize); z_stream Stream = {}; diff --git a/src/zenserver/proxy/zenproxyserver.cpp b/src/zenserver/proxy/zenproxyserver.cpp index 7e59a7b7e..4d4486cbb 100644 --- a/src/zenserver/proxy/zenproxyserver.cpp +++ b/src/zenserver/proxy/zenproxyserver.cpp @@ -257,7 +257,7 @@ ZenProxyServerConfigurator::ValidateOptions() for (const std::string& Raw : m_RawProxyMappings) { // The mode keyword "proxy" from argv[1] gets captured as a positional - // argument — skip it. + // argument - skip it. if (Raw == "proxy") { continue; @@ -304,7 +304,7 @@ ZenProxyServer::Initialize(const ZenProxyServerConfig& ServerConfig, ZenServerSt // worker threads don't exit prematurely between async operations. m_ProxyIoWorkGuard.emplace(m_ProxyIoContext.get_executor()); - // Start proxy I/O worker threads. Use a modest thread count — proxy work is + // Start proxy I/O worker threads. Use a modest thread count - proxy work is // I/O-bound so we don't need a thread per core, but having more than one // avoids head-of-line blocking when many connections are active. unsigned int ThreadCount = std::max(GetHardwareConcurrency() / 4, 4u); diff --git a/src/zenserver/sessions/httpsessions.cpp b/src/zenserver/sessions/httpsessions.cpp index c21ae6a5c..56a22fb04 100644 --- a/src/zenserver/sessions/httpsessions.cpp +++ b/src/zenserver/sessions/httpsessions.cpp @@ -377,7 +377,7 @@ HttpSessionsService::SessionLogRequest(HttpRouterRequest& Req) if (ServerRequest.RequestContentType() == HttpContentType::kText) { - // Raw text — split by newlines, one entry per line + // Raw text - split by newlines, one entry per line IoBuffer Payload = ServerRequest.ReadPayload(); std::string_view Text(reinterpret_cast<const char*>(Payload.GetData()), Payload.GetSize()); const DateTime Now = DateTime::Now(); diff --git a/src/zenserver/sessions/sessions.cpp b/src/zenserver/sessions/sessions.cpp index 1212ba5d8..9d4e3120c 100644 --- a/src/zenserver/sessions/sessions.cpp +++ b/src/zenserver/sessions/sessions.cpp @@ -129,7 +129,7 @@ SessionsService::~SessionsService() = default; bool SessionsService::RegisterSession(const Oid& SessionId, std::string AppName, std::string Mode, const Oid& JobId, CbObjectView Metadata) { - // Log outside the lock scope — InProcSessionLogSink calls back into + // Log outside the lock scope - InProcSessionLogSink calls back into // GetSession() which acquires m_Lock shared, so logging while holding // m_Lock exclusively would deadlock. { diff --git a/src/zenserver/zenserver.cpp b/src/zenserver/zenserver.cpp index 087b40d6a..e9e7a2c33 100644 --- a/src/zenserver/zenserver.cpp +++ b/src/zenserver/zenserver.cpp @@ -699,7 +699,7 @@ ZenServerMain::Run() // The entry's process failed to pick up our sponsor request after // multiple attempts. Before reclaiming the entry, verify that the // PID does not still belong to a zenserver process. If it does, the - // server is alive but unresponsive – fall back to the original error + // server is alive but unresponsive - fall back to the original error // path. If the PID is gone or belongs to a different executable the // entry is genuinely stale and safe to reclaim. const int StalePid = Entry->Pid.load(); @@ -717,7 +717,7 @@ ZenServerMain::Run() } ZEN_CONSOLE_WARN( "Failed to add sponsor to process on port {} (pid {}); " - "pid belongs to '{}' – assuming stale entry and reclaiming", + "pid belongs to '{}' - assuming stale entry and reclaiming", m_ServerOptions.BasePort, StalePid, ExeEc ? "<unknown>" : PidExePath.filename().string()); diff --git a/src/zentelemetry/include/zentelemetry/stats.h b/src/zentelemetry/include/zentelemetry/stats.h index 260b0fcfb..ddec8e883 100644 --- a/src/zentelemetry/include/zentelemetry/stats.h +++ b/src/zentelemetry/include/zentelemetry/stats.h @@ -40,7 +40,7 @@ private: * Suitable for tracking quantities that go up and down over time, such as * requests in flight or active jobs. All operations are lock-free via atomics. * - * Unlike a Meter, a Counter does not track rates — it only records a running total. + * Unlike a Meter, a Counter does not track rates - it only records a running total. */ class Counter { @@ -63,7 +63,7 @@ private: * rate = rate + alpha * (instantRate - rate) * * where instantRate = Count / Interval. The alpha value controls how quickly - * the average responds to changes — higher alpha means more weight on recent + * the average responds to changes - higher alpha means more weight on recent * samples. Typical alphas are derived from a decay half-life (e.g. 1, 5, 15 * minutes) and a fixed tick interval. * @@ -205,7 +205,7 @@ private: * * Records exact min, max, count and mean across all values ever seen, plus a * reservoir sample (via UniformSample) used to compute percentiles. Percentiles - * are therefore probabilistic — they reflect the distribution of a representative + * are therefore probabilistic - they reflect the distribution of a representative * sample rather than the full history. * * All operations are thread-safe via lock-free atomics. @@ -343,7 +343,7 @@ struct RequestStatsSnapshot * * Maintains two independent histogram+meter pairs: one for request duration * (in hi-freq timer ticks) and one for transferred bytes. Both dimensions - * share the same request count — a single Update() call advances both. + * share the same request count - a single Update() call advances both. * * Duration accessors return values in hi-freq timer ticks. Multiply by * GetHifreqTimerToSeconds() to convert to seconds. @@ -383,7 +383,7 @@ public: * or destruction. * * The byte count can be supplied at construction or updated at any point via - * SetBytes() before the scope ends — useful when the response size is not + * SetBytes() before the scope ends - useful when the response size is not * known until the operation completes. * * Call Cancel() to discard the measurement entirely. diff --git a/src/zentelemetry/otelmetricsprotozero.h b/src/zentelemetry/otelmetricsprotozero.h index 12bae0d75..f02eca7ab 100644 --- a/src/zentelemetry/otelmetricsprotozero.h +++ b/src/zentelemetry/otelmetricsprotozero.h @@ -49,22 +49,22 @@ option go_package = "go.opentelemetry.io/proto/otlp/metrics/v1"; // data but do not implement the OTLP protocol. // // MetricsData -// └─── ResourceMetrics -// ├── Resource -// ├── SchemaURL -// └── ScopeMetrics -// ├── Scope -// ├── SchemaURL -// └── Metric -// ├── Name -// ├── Description -// ├── Unit -// └── data -// ├── Gauge -// ├── Sum -// ├── Histogram -// ├── ExponentialHistogram -// └── Summary +// +--- ResourceMetrics +// |-- Resource +// |-- SchemaURL +// +-- ScopeMetrics +// |-- Scope +// |-- SchemaURL +// +-- Metric +// |-- Name +// |-- Description +// |-- Unit +// +-- data +// |-- Gauge +// |-- Sum +// |-- Histogram +// |-- ExponentialHistogram +// +-- Summary // // The main difference between this message and collector protocol is that // in this message there will not be any "control" or "metadata" specific to diff --git a/src/zenutil/cloud/imdscredentials.cpp b/src/zenutil/cloud/imdscredentials.cpp index 5a6cf45d2..b025eb6da 100644 --- a/src/zenutil/cloud/imdscredentials.cpp +++ b/src/zenutil/cloud/imdscredentials.cpp @@ -213,7 +213,7 @@ ImdsCredentialProvider::FetchCredentials() } else { - // Expiration is in the past or unparseable — force refresh next time + // Expiration is in the past or unparseable - force refresh next time NewExpiresAt = std::chrono::steady_clock::now(); } @@ -369,7 +369,7 @@ TEST_CASE("imdscredentials.fetch_from_mock") TEST_CASE("imdscredentials.unreachable_endpoint") { - // Point at a non-existent server — should return empty credentials, not crash + // Point at a non-existent server - should return empty credentials, not crash ImdsCredentialProviderOptions Opts; Opts.Endpoint = "http://127.0.0.1:1"; // unlikely to have anything listening Opts.ConnectTimeout = std::chrono::milliseconds(100); diff --git a/src/zenutil/cloud/minioprocess.cpp b/src/zenutil/cloud/minioprocess.cpp index e146f6677..2db0010dc 100644 --- a/src/zenutil/cloud/minioprocess.cpp +++ b/src/zenutil/cloud/minioprocess.cpp @@ -102,7 +102,7 @@ struct MinioProcess::Impl { if (m_DataDir.empty()) { - ZEN_WARN("MinIO: Cannot create bucket before data directory is initialized — call SpawnMinioServer() first"); + ZEN_WARN("MinIO: Cannot create bucket before data directory is initialized - call SpawnMinioServer() first"); return; } diff --git a/src/zenutil/cloud/mockimds.cpp b/src/zenutil/cloud/mockimds.cpp index 6919fab4d..88b348ed6 100644 --- a/src/zenutil/cloud/mockimds.cpp +++ b/src/zenutil/cloud/mockimds.cpp @@ -93,7 +93,7 @@ MockImdsService::HandleAwsRequest(HttpServerRequest& Request) return; } - // Autoscaling lifecycle state — 404 when not in an ASG + // Autoscaling lifecycle state - 404 when not in an ASG if (Uri == "latest/meta-data/autoscaling/target-lifecycle-state") { if (Aws.AutoscalingState.empty()) @@ -105,7 +105,7 @@ MockImdsService::HandleAwsRequest(HttpServerRequest& Request) return; } - // Spot interruption notice — 404 when no interruption pending + // Spot interruption notice - 404 when no interruption pending if (Uri == "latest/meta-data/spot/instance-action") { if (Aws.SpotAction.empty()) @@ -117,7 +117,7 @@ MockImdsService::HandleAwsRequest(HttpServerRequest& Request) return; } - // IAM role discovery — returns the role name + // IAM role discovery - returns the role name if (Uri == "latest/meta-data/iam/security-credentials/") { if (Aws.IamRoleName.empty()) diff --git a/src/zenutil/cloud/s3client.cpp b/src/zenutil/cloud/s3client.cpp index ef4b344ce..83238f5cc 100644 --- a/src/zenutil/cloud/s3client.cpp +++ b/src/zenutil/cloud/s3client.cpp @@ -932,7 +932,7 @@ TEST_CASE("s3client.minio_integration") using namespace std::literals; // Spawn a single MinIO server for the entire test case. Previously each SUBCASE re-entered - // the TEST_CASE from the top, spawning and killing MinIO per subcase — slow and flaky on + // the TEST_CASE from the top, spawning and killing MinIO per subcase - slow and flaky on // macOS CI. Sequential sections avoid the re-entry while still sharing one MinIO instance // that is torn down via RAII at scope exit. MinioProcessOptions MinioOpts; diff --git a/src/zenutil/consoletui.cpp b/src/zenutil/consoletui.cpp index 124132aed..10e8abb31 100644 --- a/src/zenutil/consoletui.cpp +++ b/src/zenutil/consoletui.cpp @@ -311,7 +311,7 @@ TuiPickOne(std::string_view Title, std::span<const std::string> Items) printf("\033[1;7m"); // bold + reverse video } - // \xe2\x96\xb6 = U+25B6 BLACK RIGHT-POINTING TRIANGLE (▶) + // \xe2\x96\xb6 = U+25B6 BLACK RIGHT-POINTING TRIANGLE (>) const char* Indicator = IsSelected ? " \xe2\x96\xb6 " : " "; printf("%s%s", Indicator, Items[i].c_str()); @@ -328,7 +328,7 @@ TuiPickOne(std::string_view Title, std::span<const std::string> Items) printf("\r\033[K\n"); // Hint footer - // \xe2\x86\x91 = U+2191 ↑ \xe2\x86\x93 = U+2193 ↓ + // \xe2\x86\x91 = U+2191 ^ \xe2\x86\x93 = U+2193 v printf( "\r\033[K \033[2m\xe2\x86\x91/\xe2\x86\x93\033[0m navigate " "\033[2mEnter\033[0m confirm " diff --git a/src/zenutil/consul/consul.cpp b/src/zenutil/consul/consul.cpp index 430ad0e32..c372b131d 100644 --- a/src/zenutil/consul/consul.cpp +++ b/src/zenutil/consul/consul.cpp @@ -245,7 +245,7 @@ ConsulClient::DeregisterService(std::string_view ServiceId) return true; } - // Agent deregister failed — fall back to catalog deregister. + // Agent deregister failed - fall back to catalog deregister. // This handles cases where the service was registered via a different Consul agent // (e.g. load-balanced endpoint routing to different agents). std::string NodeName = GetNodeName(); diff --git a/src/zenutil/include/zenutil/cloud/mockimds.h b/src/zenutil/include/zenutil/cloud/mockimds.h index d0c0155b0..28e1e8ba6 100644 --- a/src/zenutil/include/zenutil/cloud/mockimds.h +++ b/src/zenutil/include/zenutil/cloud/mockimds.h @@ -23,7 +23,7 @@ namespace zen::compute { * * When a request arrives for a provider that is not the ActiveProvider, the * mock returns 404, causing CloudMetadata to write a sentinel file and move - * on to the next provider — exactly like a failed probe on bare metal. + * on to the next provider - exactly like a failed probe on bare metal. * * All config fields are public and can be mutated between poll cycles to * simulate state changes (e.g. a spot interruption appearing mid-run). @@ -45,13 +45,13 @@ public: std::string AvailabilityZone = "us-east-1a"; std::string LifeCycle = "on-demand"; // "spot" or "on-demand" - // Empty string → endpoint returns 404 (instance not in an ASG). - // Non-empty → returned as the response body. "InService" means healthy; + // Empty string -> endpoint returns 404 (instance not in an ASG). + // Non-empty -> returned as the response body. "InService" means healthy; // anything else (e.g. "Terminated:Wait") triggers termination detection. std::string AutoscalingState; - // Empty string → endpoint returns 404 (no spot interruption). - // Non-empty → returned as the response body, signalling a spot reclaim. + // Empty string -> endpoint returns 404 (no spot interruption). + // Non-empty -> returned as the response body, signalling a spot reclaim. std::string SpotAction; // IAM credential fields for ImdsCredentialProvider testing @@ -69,10 +69,10 @@ public: std::string Location = "eastus"; std::string Priority = "Regular"; // "Spot" or "Regular" - // Empty → instance is not in a VM Scale Set (no autoscaling). + // Empty -> instance is not in a VM Scale Set (no autoscaling). std::string VmScaleSetName; - // Empty → no scheduled events. Set to "Preempt", "Terminate", or + // Empty -> no scheduled events. Set to "Preempt", "Terminate", or // "Reboot" to simulate a termination-class event. std::string ScheduledEventType; std::string ScheduledEventStatus = "Scheduled"; diff --git a/src/zenutil/include/zenutil/consoletui.h b/src/zenutil/include/zenutil/consoletui.h index 22737589b..49bb0cc92 100644 --- a/src/zenutil/include/zenutil/consoletui.h +++ b/src/zenutil/include/zenutil/consoletui.h @@ -30,7 +30,7 @@ bool IsTuiAvailable(); // - Title: a short description printed once above the list // - Items: pre-formatted display labels, one per selectable entry // -// Arrow keys (↑/↓) navigate the selection, Enter confirms, Esc cancels. +// Arrow keys (^/v) navigate the selection, Enter confirms, Esc cancels. // Returns the index of the selected item, or -1 if the user cancelled. // // Precondition: IsTuiAvailable() must be true. diff --git a/src/zenutil/include/zenutil/process/subprocessmanager.h b/src/zenutil/include/zenutil/process/subprocessmanager.h index e16c0c446..95d7fa43d 100644 --- a/src/zenutil/include/zenutil/process/subprocessmanager.h +++ b/src/zenutil/include/zenutil/process/subprocessmanager.h @@ -97,7 +97,7 @@ public: /// If Options.StdoutPipe is set, the pipe is consumed and async reading /// begins automatically. Similarly for Options.StderrPipe. When providing /// pipes, pass the corresponding data callback here so it is installed - /// before the first async read completes — setting it later via + /// before the first async read completes - setting it later via /// SetStdoutCallback risks losing early output. /// /// Returns a non-owning pointer valid until Remove() or manager destruction. @@ -112,7 +112,7 @@ public: /// Adopt an already-running process by handle. Takes ownership of handle internals. ManagedProcess* Adopt(ProcessHandle&& Handle, ProcessExitCallback OnExit); - /// Stop monitoring a process by pid. Does NOT kill the process — call + /// Stop monitoring a process by pid. Does NOT kill the process - call /// process->Kill() first if needed. The exit callback will not fire after /// this returns. void Remove(int Pid); @@ -219,7 +219,7 @@ private: /// A group of managed processes with OS-level backing. /// /// On Windows: backed by a JobObject. All processes assigned on spawn. -/// Kill-on-close guarantee — if the group is destroyed, the OS terminates +/// Kill-on-close guarantee - if the group is destroyed, the OS terminates /// all member processes. /// On Linux/macOS: uses setpgid() so children share a process group. /// Enables bulk signal delivery via kill(-pgid, sig). diff --git a/src/zenutil/include/zenutil/sessionsclient.h b/src/zenutil/include/zenutil/sessionsclient.h index aca45e61d..12ff5e593 100644 --- a/src/zenutil/include/zenutil/sessionsclient.h +++ b/src/zenutil/include/zenutil/sessionsclient.h @@ -35,13 +35,13 @@ public: SessionsServiceClient(const SessionsServiceClient&) = delete; SessionsServiceClient& operator=(const SessionsServiceClient&) = delete; - /// POST /sessions/{id} — register or re-announce the session with optional metadata. + /// POST /sessions/{id} - register or re-announce the session with optional metadata. [[nodiscard]] bool Announce(CbObjectView Metadata = {}); - /// PUT /sessions/{id} — update metadata on an existing session. + /// PUT /sessions/{id} - update metadata on an existing session. [[nodiscard]] bool UpdateMetadata(CbObjectView Metadata = {}); - /// DELETE /sessions/{id} — remove the session. + /// DELETE /sessions/{id} - remove the session. [[nodiscard]] bool Remove(); /// Create a logging sink that forwards log messages to the session's log endpoint. diff --git a/src/zenutil/include/zenutil/splitconsole/tcplogstreamsink.h b/src/zenutil/include/zenutil/splitconsole/tcplogstreamsink.h index f4ac5ff22..4387e616a 100644 --- a/src/zenutil/include/zenutil/splitconsole/tcplogstreamsink.h +++ b/src/zenutil/include/zenutil/splitconsole/tcplogstreamsink.h @@ -85,12 +85,12 @@ public: void Flush() override { - // Nothing to flush — writes happen asynchronously + // Nothing to flush - writes happen asynchronously } void SetFormatter(std::unique_ptr<logging::Formatter> /*InFormatter*/) override { - // Not used — we output the raw payload directly + // Not used - we output the raw payload directly } private: @@ -124,7 +124,7 @@ private: { break; // don't retry during shutdown } - continue; // drop batch — will retry on next batch + continue; // drop batch - will retry on next batch } // Build a gathered buffer sequence so the entire batch is written @@ -176,7 +176,7 @@ private: std::string m_Source; uint32_t m_MaxQueueSize; - // Sequence counter — incremented atomically by Log() callers. + // Sequence counter - incremented atomically by Log() callers. // Gaps in the sequence seen by the receiver indicate dropped messages. std::atomic<uint64_t> m_NextSequence{0}; diff --git a/src/zenutil/logging/logging.cpp b/src/zenutil/logging/logging.cpp index df0d6b9d2..c1636da61 100644 --- a/src/zenutil/logging/logging.cpp +++ b/src/zenutil/logging/logging.cpp @@ -124,7 +124,7 @@ BeginInitializeLogging(const LoggingOptions& LogOptions) LoggerRef DefaultLogger = zen::logging::Default(); - // Build the broadcast sink — a shared indirection point that all + // Build the broadcast sink - a shared indirection point that all // loggers cloned from the default will share. Adding or removing // a child sink later is immediately visible to every logger. std::vector<logging::SinkPtr> BroadcastChildren; diff --git a/src/zenutil/logging/rotatingfilesink.cpp b/src/zenutil/logging/rotatingfilesink.cpp index 23cf60d16..df59af5fe 100644 --- a/src/zenutil/logging/rotatingfilesink.cpp +++ b/src/zenutil/logging/rotatingfilesink.cpp @@ -85,7 +85,7 @@ struct RotatingFileSink::Impl m_CurrentSize = m_CurrentFile.FileSize(OutEc); if (OutEc) { - // FileSize failed but we have an open file — reset to 0 + // FileSize failed but we have an open file - reset to 0 // so we can at least attempt writes from the start m_CurrentSize = 0; OutEc.clear(); diff --git a/src/zenutil/process/asyncpipereader.cpp b/src/zenutil/process/asyncpipereader.cpp index 2fdcda30d..8eac350c6 100644 --- a/src/zenutil/process/asyncpipereader.cpp +++ b/src/zenutil/process/asyncpipereader.cpp @@ -50,7 +50,7 @@ struct AsyncPipeReader::Impl int Fd = Pipe.ReadFd; - // Close the write end — child already has it + // Close the write end - child already has it Pipe.CloseWriteEnd(); // Set non-blocking @@ -156,7 +156,7 @@ CreateOverlappedStdoutPipe(StdoutPipeHandles& OutPipe) // The read end should not be inherited by the child SetHandleInformation(ReadHandle, HANDLE_FLAG_INHERIT, 0); - // Open the client (write) end — inheritable, for the child process + // Open the client (write) end - inheritable, for the child process SECURITY_ATTRIBUTES Sa; Sa.nLength = sizeof(Sa); Sa.lpSecurityDescriptor = nullptr; @@ -202,7 +202,7 @@ struct AsyncPipeReader::Impl HANDLE ReadHandle = static_cast<HANDLE>(Pipe.ReadHandle); - // Close the write end — child already has it + // Close the write end - child already has it Pipe.CloseWriteEnd(); // Take ownership of the read handle diff --git a/src/zenutil/process/subprocessmanager.cpp b/src/zenutil/process/subprocessmanager.cpp index 597df3c15..d0b912a0d 100644 --- a/src/zenutil/process/subprocessmanager.cpp +++ b/src/zenutil/process/subprocessmanager.cpp @@ -1447,7 +1447,7 @@ TEST_CASE("SubprocessManager.RemoveWhileRunning") // Let it start IoContext.run_for(100ms); - // Remove without killing — callback should NOT fire after this + // Remove without killing - callback should NOT fire after this Manager.Remove(Pid); IoContext.run_for(500ms); @@ -1756,7 +1756,7 @@ TEST_CASE("ProcessGroup.FindGroup") TEST_CASE("SubprocessManager.StressTest" * doctest::skip()) { - // Seed for reproducibility — change to explore different orderings + // Seed for reproducibility - change to explore different orderings // // Note that while this is a stress test, it is still single-threaded @@ -1785,7 +1785,7 @@ TEST_CASE("SubprocessManager.StressTest" * doctest::skip()) // Phase 1: Spawn multiple groups with varied workloads // ======================================================================== - ZEN_INFO("StressTest: Phase 1 — spawning initial groups"); + ZEN_INFO("StressTest: Phase 1 - spawning initial groups"); constexpr int NumInitialGroups = 8; std::vector<std::string> GroupNames; @@ -1839,7 +1839,7 @@ TEST_CASE("SubprocessManager.StressTest" * doctest::skip()) // Phase 2: Randomly kill some groups, create replacements, add ungrouped // ======================================================================== - ZEN_INFO("StressTest: Phase 2 — random group kills and replacements"); + ZEN_INFO("StressTest: Phase 2 - random group kills and replacements"); constexpr int NumGroupsToKill = 3; @@ -1904,7 +1904,7 @@ TEST_CASE("SubprocessManager.StressTest" * doctest::skip()) // Phase 3: Rapid spawn/exit churn // ======================================================================== - ZEN_INFO("StressTest: Phase 3 — rapid spawn/exit churn"); + ZEN_INFO("StressTest: Phase 3 - rapid spawn/exit churn"); std::atomic<int> ChurnExitCount{0}; int TotalChurnSpawned = 0; @@ -1928,7 +1928,7 @@ TEST_CASE("SubprocessManager.StressTest" * doctest::skip()) // Brief pump to allow some exits to be processed IoContext.run_for(200ms); - // Destroy the group — any still-running processes get killed + // Destroy the group - any still-running processes get killed Manager.DestroyGroup(Name); } @@ -1938,7 +1938,7 @@ TEST_CASE("SubprocessManager.StressTest" * doctest::skip()) // Phase 4: Drain and verify // ======================================================================== - ZEN_INFO("StressTest: Phase 4 — draining remaining processes"); + ZEN_INFO("StressTest: Phase 4 - draining remaining processes"); // Check metrics were collected before we wind down AggregateProcessMetrics Agg = Manager.GetAggregateMetrics(); @@ -1969,7 +1969,7 @@ TEST_CASE("SubprocessManager.StressTest" * doctest::skip()) // (exact count is hard to predict due to killed groups, but should be > 0) CHECK(TotalExitCallbacks.load() > 0); - ZEN_INFO("StressTest: PASSED — seed={}", Seed); + ZEN_INFO("StressTest: PASSED - seed={}", Seed); } TEST_SUITE_END(); diff --git a/src/zenutil/sessionsclient.cpp b/src/zenutil/sessionsclient.cpp index c62cc4099..df8853d20 100644 --- a/src/zenutil/sessionsclient.cpp +++ b/src/zenutil/sessionsclient.cpp @@ -21,7 +21,7 @@ namespace zen { ////////////////////////////////////////////////////////////////////////// // -// SessionLogSink — batching log sink that forwards to /sessions/{id}/log +// SessionLogSink - batching log sink that forwards to /sessions/{id}/log // static const char* @@ -108,7 +108,7 @@ public: void SetFormatter(std::unique_ptr<logging::Formatter> /*InFormatter*/) override { - // No formatting needed — we send raw message text + // No formatting needed - we send raw message text } private: @@ -226,7 +226,7 @@ private: } catch (const std::exception&) { - // Best-effort — silently discard on failure + // Best-effort - silently discard on failure } } diff --git a/src/zenutil/splitconsole/logstreamlistener.cpp b/src/zenutil/splitconsole/logstreamlistener.cpp index 289bc73a2..df985a196 100644 --- a/src/zenutil/splitconsole/logstreamlistener.cpp +++ b/src/zenutil/splitconsole/logstreamlistener.cpp @@ -17,7 +17,7 @@ ZEN_THIRD_PARTY_INCLUDES_END namespace zen { ////////////////////////////////////////////////////////////////////////// -// LogStreamSession — reads CbObject-framed messages from a single TCP connection +// LogStreamSession - reads CbObject-framed messages from a single TCP connection class LogStreamSession : public RefCounted { @@ -34,7 +34,7 @@ private: [Self](const asio::error_code& Ec, std::size_t BytesRead) { if (Ec) { - return; // connection closed or error — session ends + return; // connection closed or error - session ends } Self->m_BufferUsed += BytesRead; Self->ProcessBuffer(); @@ -119,7 +119,7 @@ private: m_BufferUsed -= Consumed; } - // If buffer is full and we can't parse a message, the message is too large — drop connection + // If buffer is full and we can't parse a message, the message is too large - drop connection if (m_BufferUsed == m_ReadBuf.size()) { ZEN_WARN("LogStreamSession: buffer full with no complete message, dropping connection"); @@ -141,7 +141,7 @@ private: struct LogStreamListener::Impl { - // Owned io_context mode — creates and runs its own thread + // Owned io_context mode - creates and runs its own thread Impl(LogStreamTarget& Target, uint16_t Port) : m_Target(Target) , m_OwnedIoContext(std::make_unique<asio::io_context>()) @@ -154,7 +154,7 @@ struct LogStreamListener::Impl }); } - // External io_context mode — caller drives the io_context + // External io_context mode - caller drives the io_context Impl(LogStreamTarget& Target, asio::io_context& IoContext, uint16_t Port) : m_Target(Target), m_Acceptor(IoContext) { SetupAcceptor(Port); @@ -367,7 +367,7 @@ TEST_CASE("DroppedMessageDetection") asio::ip::tcp::socket Socket(IoContext); Socket.connect(asio::ip::tcp::endpoint(asio::ip::make_address("127.0.0.1"), Listener.GetPort())); - // Send seq=0, then seq=5 — the listener should detect a gap of 4 + // Send seq=0, then seq=5 - the listener should detect a gap of 4 for (uint64_t Seq : {uint64_t(0), uint64_t(5)}) { CbObjectWriter Writer; |