rust

37 posts

cloudflare

Secure all your internal vibe-coded applications — in one click (opens in new tab)

AI-driven development makes it easy for employees to deploy applications, but also increases the risk of unintentionally exposing company data. Cloudflare’s new Access integration for Workers makes applications private by default at the Worker or account level, regardless of how they are reached. It also exposes authenticated user identity directly in Worker code and supports private-by-default internal deployment platforms. ## Worker-Level Access Protection - Access authentication is enforced before requests reach application code. - Protection applies across custom domains, routes, `workers.dev` subdomains, and preview URLs. - Policies can cover: - Preview deployments only - Every hostname associated with a Worker - Attaching policies to the Worker eliminates the need to update Access settings whenever a new domain is added. - Existing identity providers, email addresses, domains, groups, and service tokens can control access. ## Account-Wide Private Defaults - An account-level policy automatically protects all current and future Workers. - Organizations can protect preview traffic, production traffic, or both. - Public Workers can explicitly bypass the account-wide policy. - For individual applications, Worker policies provide targeted protection. - When multiple policies apply, precedence is: - Hostname policies - Worker policies - Account policies ## Accessing User Identity in Worker Code - Authenticated requests expose identity through `ctx.access`. - `ctx.access.getIdentity()` returns information such as: - Email address - Name - Groups - Developers no longer need to parse, validate, and extract claims from Access JWTs manually. - Applications can use this identity for personalization, authorization, and per-user logging. - Code should handle requests without Access metadata, for example by returning a `403` response. ## Local Development and Testing - `wrangler dev` can simulate authenticated users locally. - An `access.dev` block in `wrangler.jsonc` defines a test audience and identity: ```json { "access": { "dev": { "aud": "my-app", "identity": { "email": "admin@company.com" } } } } ``` - Developers can change the configured email to test different user experiences without repeatedly deploying and authenticating through Access. ## Private Internal Deployment Platforms - Workers for Platforms can host many applications inside a namespace. - Traffic is routed through a shared dispatch Worker. - Protecting the dispatch Worker with Access makes every application deployed through it private by default. - Cloudflare provides an open-source example of an internal drag-and-drop deployment platform using this model. ## Infrastructure Behind the Feature - The capability relies on FL2, Cloudflare’s Rust-based modular proxy. - Workers routing had to be separated from execution so Cloudflare could determine the destination Worker before applying Access. - This routing change would have been more difficult in the older NGINX- and Lua-based FL1 architecture. Cloudflare’s approach shifts application security from an optional developer-configured step to an organizational default. Teams deploying internal or experimental Workers should use account-level or dispatch-level Access policies, while using Worker-level policies and local identity simulation for application-specific control and testing.

cloudflare

Introducing Kitesurf: The agent-first browser that runs in V8 isolates on Cloudflare Workers (opens in new tab)

Cloudflare argues that AI agents need a browser optimized for machine tasks rather than human browsing. Chromium provides far more functionality than agents require while consuming too much memory and compute, limiting accessibility and scalability. The company therefore built Kitesurf, a lightweight browser running entirely on Workers and designed for agentic workloads. ## Why Cloudflare Built a New Browser - Cloudflare had repeatedly considered building a browser but previously found the technical investment difficult to justify. - Recent advances in its Developer Platform changed the equation: - Mature WebAssembly support in Workers - Dynamic workers - SQLite-based Durable Objects - Worker-to-worker RPC and service bindings - Improved Node.js compatibility and higher platform limits - Growing demand for AI browser automation exposed Chromium’s limitations: - High CPU and memory consumption - Expensive dedicated browser instances - Poor scalability for large numbers of agents ## Designing for Agents Instead of Humans - Agents prioritize: - Low token counts - Large context windows - Scalability and performance - Low operating costs - Structured, machine-readable content - They do not need many human-oriented features, such as: - Tabs, themes, extensions, and device synchronization - Pixel-perfect rendering - Smooth 60-frame-per-second scrolling - AI browser security requires a different threat model, with prompt injection and tool safety treated as central concerns. - Kitesurf became the result: a browser available in beta through Cloudflare’s Browser Run product. ## From Prototype to Product - The project began with inspiration from Obscura, a lightweight Rust headless engine for AI automation. - Cloudflare used an AI agent to attempt a port to Workers. - The first prototype was weak, but a detailed plan and explicit success criteria allowed the agent to iterate effectively. - The promising proof of concept led the team to develop Kitesurf further. ## Testing as a Foundation - Cloudflare relied heavily on automated testing to accelerate development without sacrificing quality. - Web Platform Tests (WPT) provided standards-based criteria for implementing browser features. - Engineers curated feature assignments and sequencing so AI agents could work toward measurable goals. - Because WPT does not fully capture real-world website behavior, Cloudflare added: - Multistep Puppeteer integration tests - Comparisons against Chromium - Visual regression checks at every interaction step - This combination tested both standards conformance and practical rendering behavior. ## Rust and WebAssembly - Kitesurf uses Rust wherever possible and compiles directly to WebAssembly with `wasm-bindgen`. - This avoids the bulk and performance costs associated with Emscripten’s emulation layers and mocked dependencies. - The approach allows browser components to run closer to native performance inside Workers. ## Resilience Through Exception Handling - Since browsers must process unreliable and potentially hostile web content, failures must not terminate entire sessions. - Kitesurf follows a strict rule: - Errors degrade to a blank frame or missing element - Faults are caught at component boundaries - Safe empty defaults are used - Diagnostic information is logged - This makes individual rendering failures survivable rather than allowing malformed input to crash the browser. ## Isolation and Statelessness - Every page load is treated as untrusted input. - Sessions begin fresh, and components receive only the resources they require. - Workers provide isolation boundaries, but Kitesurf also enforces isolation within the application itself to prevent data leakage between pages. - Components are kept stateless wherever possible: - Failed components can simply be recreated - Work can be scaled horizontally and run in parallel - Burst-based workloads avoid the cost of maintaining idle instances - Recovery can consist of restarting a component and replaying a request Kitesurf’s central recommendation is to build browsers around the needs of their users—in this case, AI agents. By sacrificing human-focused features and emphasizing efficiency, structured output, isolation, resilience, and scale, Cloudflare aims to make browser automation practical for a much broader range of agentic applications.

cloudflare

How Cloudflare enforces engineering standards using AI (opens in new tab)

Cloudflare built the Codex to turn scattered engineering knowledge into governed, machine-readable standards that both engineers and AI agents can apply consistently. It now supports code reviews, technical design reviews, and incident reviews, with AI systems flagging nearly 230,000 violations and blocking about 16,000 merges. The central approach is to combine human-owned RFCs with structured extraction, staged enforcement, and context-aware agents. ## Why Cloudflare Built the Codex - Engineering guidance previously existed across formal documentation, repositories, chat, and individual experience. - Engineers struggled to determine whether guidance was current, authoritative, or relevant. - Growth made it difficult for anyone to know every standard or for reviewers to check every requirement. - The Codex provides a shared source of truth that can be retrieved and applied at the point of work. ## Governance and RFC Workflow - The Codex is divided into domains such as: - Architecture and control plane systems - Security and reliability - Programming languages including TypeScript and Rust - Each domain has an owner responsible for content quality and consistency. - Standards follow an RFC format using RFC 2119 terminology: - **SHOULD** for recommendations - **MUST** for mandatory requirements - Employees can propose RFCs through structured merge requests. - Proposals undergo increasingly broad review before domain-owner approval. - Approved RFCs are published to an internal Astro-powered site. - Enforcement is deliberately separated from approval: - Approved standards can generate findings. - Only enforced standards can block merges. - This gives teams time to adopt requirements and implement enforcement mechanisms. ## Structured Standards for Agents - Feeding all 60-plus RFCs directly into an LLM would consume too much context and reduce accuracy. - A dedicated agent extracts SHOULD and MUST statements into structured JSON. - Each statement includes: - A stable slug - RFC and domain metadata - Requirement level - Section and source link - Stable identifiers allow Cloudflare to track requirements across RFC revisions, systems, monitoring, and exception handling. - Cloudflare moved from concise Markdown extraction to JSON to enable filtering and progressive disclosure. - Future metadata may identify which SDLC stage applies, such as design, implementation, or runtime. ## AI Code Review - The AI code reviewer retrieves relevant statements first and loads complete RFCs only when more context is needed. - Approved-RFC findings are non-blocking recommendations. - Violations of MUST requirements in enforced RFCs can withhold approval or block a merge. - Since launch, the reviewer has: - Flagged nearly 230,000 violations - Withheld approval for almost 16,000 violations ## Faster Code Review Alternatives - Full AI reviews generally take several minutes because they use coordinators and multiple agents. - To reduce remediation delays, Cloudflare is also developing mechanically verifiable checks. - Language-specific Codex requirements can be distributed through custom linter configuration packages. - TypeScript was the first language to receive Codex linter support, alongside standardization on oxlint. The Codex’s practical value comes from connecting governed human standards to automated enforcement. Cloudflare’s staged RFC lifecycle, stable statement identifiers, and combination of AI review with fast linters provide a scalable way to preserve engineering knowledge while reducing review inconsistency.

github

Don’t stop early: Case-folding source code at memory speed (opens in new tab)

Case folding converts text into a canonical, case-insensitive form for comparisons, making it essential to GitHub’s large-scale code search. GitHub optimized this operation by removing an apparent optimization: instead of stopping at the first non-ASCII byte, it scans the entire buffer branchlessly, enabling SIMD vectorization. The resulting Rust `casefold` crate processes ASCII at over 45 GiB/s—close to memory-bandwidth limits. ## Case Folding Is Not Lowercasing - Lowercasing is intended for display and can depend on locale or context. - Greek sigma may become `ς` or `σ`. - Turkish `I` has locale-specific behavior. - Case folding is intended for comparison and must be locale-independent and symmetric. - Unicode provides explicit rules in `CaseFolding.txt`. - The crate supports simple one-to-one folds (statuses C and S), but not: - Full folds such as `ß → ss` - Turkic-specific folds such as dotted `İ` - This restriction matches tools such as ripgrep and helps maintain consistent matching behavior. ## Why Case-Folding Performance Matters - GitHub’s Blackbird search engine indexes more than: - 180 million repositories - 480 TB of source code - Source bytes are case-folded before n-gram extraction and indexing. - Folding is also needed when evaluating potential query matches. - Since most source code is ASCII, optimizing the ASCII path provides the largest benefit. ## Removing the Early Exit - A conventional implementation scans until it finds a non-ASCII byte, then switches to Unicode processing. - On an Apple M4, this branch-heavy approach reached only about 3.1 GiB/s. - The optimized loop: - ORs every byte into an accumulator to detect non-ASCII data once. - Uses `b.wrapping_sub(b'A') < 26` as a branchless uppercase test. - Sets bit 5 with `| (is_upper << 5)` to lowercase uppercase ASCII letters. - The loop always processes and writes the entire buffer, then checks whether Unicode processing is necessary. ## Vectorization Beats Early Termination - Removing the data-dependent `break` allows LLVM to vectorize the loop with 16-byte NEON instructions. - Performance progression on a 5.7 KB ASCII buffer: - Naive branchy loop: 3.1 GiB/s - Branchless body with early exit: 2.6 GiB/s - Early exit removed: 7.6 GiB/s - Fully branchless loop: over 45 GiB/s - The early exit prevents vectorization even when the loop body is otherwise branch-free. - Branchless arithmetic then eliminates compare-and-blend overhead and enables full memory-speed performance. ## Why Branchless Code Can Be Slower - In scalar code, the branchless version writes every byte, even when no change is needed. - The branchy version skips stores for the majority of lowercase letters, digits, spaces, and other unchanged bytes. - Its conditional branch is highly predictable, so it is inexpensive. - Branchless writes become beneficial only after vectorization, where the processor handles a whole vector at once. The practical lesson is to avoid data-dependent loop exits when they block vectorization. For predominantly ASCII workloads, a complete branchless scan can outperform “stop as soon as possible” logic by a wide margin, while an accumulated high-bit check efficiently identifies inputs requiring Unicode handling.

aws

Amazon EC2 C9g and C9gd instances powered by AWS Graviton5 processors are now available | Amazon Web Services (opens in new tab)

Amazon EC2 C9g and C9gd instances, powered by AWS Graviton5, are now generally available for compute-intensive workloads. They provide up to 25% better performance per vCPU than C8g, faster DDR5 memory, larger caches, and improved networking and EBS bandwidth. C9gd adds local NVMe SSD storage, making it suitable for workloads requiring both high CPU performance and low-latency temporary storage. ## Graviton5 Performance Improvements - Up to 25% higher performance per vCPU than previous-generation C8g instances. - DDR5 memory running at 8800 MT/s, described as the fastest memory available in a cloud processor instance. - Five times more L3 cache than Graviton4-based instances. - Up to three times higher packet-processing performance than Graviton4. - Benefits include faster in-memory analytics, higher throughput, and more responsive real-time applications. ## C9g and C9gd Workloads - C9g is designed for compute-heavy applications using Amazon EBS, including: - Batch processing - Video encoding - Distributed analytics - CPU-based machine learning inference - Agentic AI workloads - C9gd adds local NVMe SSD storage for: - HPC simulation scratch space - Machine learning inference caches - Ad-serving buffers - Other low-latency temporary-storage use cases - C9gd delivers up to 30% higher local storage performance than the previous generation. ## Networking, Storage, and Configuration - Available in 11 sizes from medium through 48xlarge, plus bare metal. - Up to 15% higher network bandwidth and 20% higher EBS bandwidth on average compared with the prior generation. - The largest instances provide up to 100 Gbps networking and 72 Gbps EBS bandwidth. - Instance Bandwidth Configuration allows up to 25% of bandwidth to be shifted between EBS and VPC networking. - Support includes ENA Express, up to 128 EBS volumes, and On-Demand, Spot, Savings Plans, Dedicated Instances, and Dedicated Hosts. - NVMe-equipped instances expose detailed I/O statistics, including latency histograms by I/O size at one-second granularity through CloudWatch or `nvme-cli`. ## Nitro Isolation Engine - C9g and C9gd are the first compute-optimized EC2 instances to use the AWS Nitro Isolation Engine. - The Rust-based Nitro System component isolates virtual machines by mediating access to memory, CPU register state, and I/O devices through a minimal API set. - AWS provides additional technical documentation covering the engine and its formal verification results. ## Availability - The instances are available in US East (Ohio and Northern Virginia), US West (Oregon), and Europe (Frankfurt). - They can be launched through the AWS Management Console, CLI, or SDKs, with more regions planned. For compute-intensive workloads, C9g is the general-purpose choice, while C9gd is preferable when fast local NVMe storage is also required.

gitlab

What's new in Git 2.55.0? (opens in new tab)

Git 2.55.0 introduces improvements focused on stacked-branch workflows, large repositories, multi-remote setups, and clearer history visualization. Highlights include `git history fixup`, a built-in Linux filesystem monitor, remote-group pushing, and a configurable width limit for `git log --graph`. The release also continues Git’s Rust adoption and improves performance for partial clones. ## `git history fixup` - Adds `git history fixup <commit-id>`. - Takes staged changes and amends them directly into an existing commit. - Avoids creating a separate fixup commit and running an interactive autosquash rebase. - Automatically updates other local branches containing the amended commit, making it useful for stacked branches. ## Built-in fsmonitor support for Linux - Git’s filesystem monitor speeds up `git status` by tracking changed files instead of scanning the entire worktree. - Git 2.55 extends the built-in `core.fsmonitor=true` daemon from Windows and macOS to GNU/Linux. - Linux support uses `inotify`, avoiding the elevated privileges required by `fanotify`. - The daemon needs a watcher for every repository directory, so large repositories may require increasing `fs.inotify.max_user_watches`. ## Pushing to remote groups - Remote groups were previously supported by `git fetch` but not `git push`. - Configure a group, for example: ```bash git config set remotes.forks "origin upstream" ``` - Push to every remote in the group with: ```bash git push forks main ``` - Each remote is handled independently and follows its own `remote.<name>.push` mappings and mirror settings. ## Limiting `git log --graph` width - `git log --graph` can become difficult to read in repositories with many parallel branches. - Git 2.55 adds a way to limit the graph’s lane width, preventing the ASCII history from expanding indefinitely. - This is particularly useful for large projects such as Git itself, where the graph can become many lanes wide after only a few commits. ## Rust adoption and partial-clone performance - The release continues the gradual evolution of Rust within Git’s codebase. - `git grep` and `git cherry` receive performance improvements when operating in partial clones. Git 2.55 is especially useful for developers working in large monorepos or stacked-branch workflows. Enabling the Linux fsmonitor, using `git history fixup`, and configuring remote groups can provide immediate productivity benefits, while graph-width limits make complex histories easier to inspect.

cloudflare

How we found a bug in the hyper HTTP library (opens in new tab)

The Images binding’s migration to a local Unix-socket architecture exposed a rare race condition in Rust’s `hyper` HTTP library. Under slow-reader conditions, large image responses were truncated even though they returned `200 OK` and a full `Content-Length`, causing downstream processing or image decoding to fail. After six weeks of investigation, the issue was traced to premature socket shutdown and fixed with four lines of code. ## Images Bindings and the Request Path - Cloudflare’s Images service runs on Workers and uses `hyper` to manage HTTP connections. - The Images binding lets Workers send image data directly to the service, chain transformations, and receive the processed result as a stream. - The response path involved: - The Images service generating the complete encoded image. - `hyper` buffering the response. - Data moving through socket buffers managed by the kernel. - A client or intermediary reading the response. - If the reader was fast, `hyper` could flush the entire response and safely shut down the socket. - If the reader was slower, the socket’s outbound buffer filled, requiring `hyper` to pause and resume writing. ## Moving from FL to Local Unix Sockets - Initially, binding traffic passed through Cloudflare’s FL intermediary service. - In December 2025, the Images team replaced FL with an internal binding running on the same machine. - Unix sockets removed network and FL-processing overhead, including routing and DNS work. - The redesign improved performance and allowed the Images team to release binding changes independently. - The bug appeared within days of the rollout. ## Successful Responses with Truncated Bodies - The first report involved nested image-processing pipelines: - An inner Images binding composited large JPEG and PNG inputs from R2. - An outer URL-based pipeline resized, compressed, and transcoded the result. - The inner pipeline returned `200 OK` and a `Content-Length` for several megabytes, but delivered only a fraction of the body. - One response contained roughly 200 KB instead of the expected 3.3 MB. - The outer pipeline reported an end-of-file error because the body ended before the declared message length. - Depending on the image format, clients saw partially rendered images or completely broken images. ## Reproducing and Isolating the Race - Engineers recreated the nested setup, then removed layers until the failure occurred with the binding alone. - Batch testing produced failures reliably—for example, 19 of 25 requests in one run. - The amount of data received, approximately 200 KB, closely matched the production socket-buffer size. - This indicated that the failure was related to backpressure and socket-buffer exhaustion rather than the customer’s specific configuration. - Investigation eventually identified a race in `hyper` where the connection could be shut down before buffered response data had finished flushing. The incident demonstrates that HTTP success status codes do not guarantee complete response bodies when connection handling is incorrect. Systems streaming large payloads over sockets should test slow-reader and backpressure scenarios, and libraries should only close connections after all buffered data has been written.

github

Give GitHub Copilot CLI real code intelligence with language servers (opens in new tab)

GitHub Copilot CLI can understand code far more accurately when connected to a Language Server Protocol (LSP) server. Without LSP, it relies on grep, package-directory browsing, and bytecode extraction, which can miss types, overloads, and dependencies. The LSP Setup skill automates server installation and configuration for 14 languages, giving the CLI capabilities such as type resolution, go-to-definition, and reference search. ## The Problem with Heuristic Code Understanding - Without an LSP server, Copilot CLI may: - Extract Java JAR files and grep through `.class` files. - Read installed Python packages directly. - Search through TypeScript’s `node_modules`. - These approaches use text and pattern matching rather than semantic analysis. - They often fail to correctly understand: - Generics and overloads. - Transitive types. - Compiled dependencies. - Exact method signatures and symbol relationships. - LSP requests such as `textDocument/definition` return precise source locations, resolved types, and signatures. ## How the LSP Setup Skill Works The skill automates a seven-step process: - **Language selection:** Uses `ask_user` to determine the required language. - **Operating system detection:** Identifies macOS, Linux, or Windows so it can choose the correct installation commands. - **Server lookup:** Reads curated data for 14 languages from `references/lsp-servers.md`. - **Configuration scope:** Supports: - User-wide configuration at `~/.copilot/lsp-config.json`. - Repository-specific configuration at `lsp.json` or `.github/lsp.json`. - Repository configuration takes precedence. - **Installation:** Runs the appropriate package-manager or platform-specific command, such as: - `npm install -g typescript typescript-language-server` - `brew install jdtls` - `rustup component add rust-analyzer` - **Configuration:** Adds a server under the `lspServers` object, mapping commands and file extensions to language identifiers. - **Verification:** Confirms the executable is on `PATH` and checks that the configuration is valid JSON. The skill merges new settings with existing configuration instead of overwriting other servers. It also accounts for transport differences, such as servers requiring `--stdio`. ## Supported Languages and Custom Setup - The skill provides predefined installation and configuration details for 14 languages. - If a language is not included, Copilot CLI can search for a suitable server and guide the user through manual configuration. - Each server configuration specifies: - The executable command. - Optional arguments. - File-extension mappings such as `.java` to `java`. ## Benefits After Configuration With LSP enabled, Copilot CLI can: - Resolve types across external dependencies. - Jump to definitions in third-party libraries. - Find every reference to a symbol. - Display hover documentation for functions, classes, and types. - Reduce unnecessary tool calls and avoid incorrect assumptions about APIs. - Handle larger and more complex coding tasks with IDE-like semantic understanding. ## Getting Started - Download the LSP Setup skill from the Awesome Copilot project. - Extract it into `~/.copilot/skills/`. - Restart Copilot CLI. - Ask the agent to set up LSP for a language, such as Java or Python. - Restart the CLI again, run `/lsp`, and test navigation on a dependency symbol. The practical recommendation is to configure an LSP server for each language used in a project. The setup gives Copilot CLI structured code intelligence instead of forcing it to reconstruct APIs through text searches and binary inspection.

cloudflare

Project Glasswing: what Mythos showed us (opens in new tab)

Project Glasswing found that Anthropic’s Mythos Preview represents a major advance in AI-assisted vulnerability research. Unlike conventional scanners, it can combine multiple low-level bugs into a credible exploit chain and generate working proofs by writing, compiling, and testing code iteratively. However, inconsistent refusals and a high rate of speculative findings mean capable models still require strong safeguards and human-led validation before large-scale deployment. ## Exploit Chain Construction - Mythos Preview can combine several seemingly minor vulnerabilities into a complete attack. - It can reason from primitives such as use-after-free bugs to arbitrary read/write access, control-flow hijacking, and ROP-based system takeover. - Earlier frontier models often identified individual bugs but failed to connect them into a working exploit. - This ability can elevate low-severity findings that might otherwise remain ignored in vulnerability backlogs. ## Automated Proof Generation - The model does more than describe suspected vulnerabilities: - Writes proof-of-concept code. - Compiles it in a scratch environment. - Executes it and checks whether the expected behavior occurs. - Revises its hypothesis when testing fails. - This feedback loop distinguishes plausible speculation from demonstrated exploitability. ## Inconsistent Model Refusals - Mythos Preview lacked the additional safeguards used in generally available models, but still developed emergent refusals around some offensive security tasks. - These refusals were inconsistent: - The same research task could succeed after an unrelated environmental change. - The model might confirm serious memory bugs but refuse to create an exploit. - Rephrasing the request or repeating it could produce a different result. - Organic model guardrails are therefore not reliable enough to act as a complete safety boundary. - Future publicly available cyber-capable models will need additional, deliberate safeguards beyond their learned behavior. ## The Signal-to-Noise Problem - Vulnerability research still requires determining which findings are real, exploitable, and urgent. - AI tools increase the volume of speculative findings, making triage more difficult. - Two major factors affect noise levels: - **Programming language:** C and C++ expose developers to memory bugs such as buffer overflows and out-of-bounds access, while memory-safe languages such as Rust eliminate many of these classes at compile time. Memory-unsafe projects produced more false positives. - **Model bias:** Models tend to report possible vulnerabilities even when evidence is weak, using qualifications such as “possibly” or “could in theory.” - Exploratory over-reporting may help discover novel issues, but it is costly in a production triage queue because each speculative finding consumes analyst time and model resources. ## Scaling AI-Assisted Security Research - Mythos Preview’s capabilities justify treating it as a different class of security tool rather than simply a better conventional scanner. - Scaling these systems will require: - Post-validation stages to filter speculative findings. - Sandboxed environments for compiling and testing proofs. - Human review of exploit chains and severity. - Explicit safety controls that do not depend solely on model refusals. - The main challenge is no longer only whether models can find vulnerabilities, but whether organizations can reliably validate, prioritize, and safely manage their output. Organizations should use advanced security models in controlled environments with layered safeguards and rigorous validation. Their ability to construct exploits is powerful, but their inconsistent safety behavior and noisy findings make unsupervised use inappropriate.

gitlab

Fix bugs with Codex and GitLab (opens in new tab)

Codex accelerates coding in the terminal, but producing a fix is only one part of shipping software. GitLab supplies the surrounding lifecycle: issues, merge requests, CI/CD, security scanning, code review, and human approval. The tutorial demonstrates this progression through a Rust WebSocket bug, first with local Codex, then with GitLab MCP for issue context, and finally with Codex as an external agent in GitLab Duo Agent Platform. ## Prerequisites and Project Setup - Configure Codex in the terminal, Rust/Cargo, and access to a GitLab project. - Import and clone the Tanuki IoT Platform project, then launch Codex from its repository root. - The tutorial focuses on `backend/`, where: - Sensors submit readings through a REST API. - Dashboards receive live readings through WebSocket streams. - `AGENTS.md` provides Codex with repository structure, toolchain instructions, build commands, and quality expectations. ## Reproducing the WebSocket Filtering Bug - Start the Rust metrics backend on port `9090`: ```bash PORT=9090 cargo run --manifest-path backend/rust-metrics-store/Cargo.toml ``` - Connect to a filtered WebSocket stream: ```bash websocat 'ws://localhost:9090/ws?sensor=arduino-iot-collector&metric=temperature_celsius' ``` - Submit both temperature and humidity readings for the same sensor through the REST API. - The stream incorrectly returns both metrics instead of only `temperature_celsius`, proving that the WebSocket handler does not apply the metric filter. ## Fixing the Bug with Codex - Give Codex a focused request to add metric filtering to `/ws`. - Codex examines the Rust source and identifies that the endpoint already supports `sensor` filtering but lacks an optional `metric` condition. - It updates the handler, adds tests, and keeps documentation aligned with the implementation. - Codex runs formatting, tests, and builds before creating a branch, committing, and pushing the change. - Once the merge request is created, GitLab handles: - CI/CD pipelines - Security scanning - GitLab Duo Code Review - A follow-up WebSocket test confirms that supplying both sensor and metric now returns only the requested metric. ## Adding GitLab Context with MCP - Local Codex can inspect repository files, but it cannot automatically see GitLab issues, requirements, implementation notes, merge-request discussions, or pipeline status. - The GitLab MCP server connects Codex to that development lifecycle context. - Codex can retrieve the existing issue directly instead of requiring the developer to copy its contents into the prompt. - The issue acts as the shared source of truth and includes: - The bug description - Functional behavior requirements - Non-functional requirements - Required tests - Updates to `README.md` and `AGENTS.md` - Implementation notes - This helps Codex produce a fix that satisfies the agreed requirements rather than merely addressing the symptom visible in the local code. ## Using Codex as an External GitLab Agent - The tutorial’s third workflow uses Codex inside GitLab Duo Agent Platform as an external agent. - This allows the agent to participate after the merge request is open, particularly when addressing review feedback. - GitLab remains the system coordinating issues, merge requests, pipelines, reviews, and deployment, while Codex contributes its terminal-oriented coding capabilities. - The overall workflow moves from bug report to implementation, automated validation, review feedback, revisions, and an informed human decision to ship. ## Practical Conclusion Use Codex for fast, repository-local implementation, but connect it to GitLab through MCP or Duo Agent Platform when requirements and review context matter. The strongest workflow combines Codex’s coding speed with GitLab’s issue-aware, automated, and human-governed delivery lifecycle.

discord

How Discord Automates ScyllaDB Clusters at Scale (opens in new tab)

Discord’s Persistence Infrastructure team replaced fragile, manually sequenced scripts with the Scylla Control Plane (SCP), a framework for safely automating large-scale database operations. The effort was driven by the difficulty of creating shadow clusters and managing hundreds of ScyllaDB nodes with a seven-person team. SCP emphasizes resumability, safety checks, configurable parallelism, and incremental development. ## The Scale of Discord’s Database Operations - Discord operates Elasticsearch, Postgres, and ScyllaDB infrastructure across dozens of clusters and hundreds of nodes. - ScyllaDB stores critical data, including messages, channels, servers, and much of Discord’s user data. - Routine work includes: - Rolling restarts after configuration changes - Cluster expansion as traffic grows - Operating-system upgrades without downtime - Creating test clusters for validating ScyllaDB releases - These operations require careful sequencing and continuous validation rather than simple, fire-and-forget automation. ## From Scripts to the Scylla Control Plane - Discord initially accumulated Python, Bash, and other scripts incrementally. - The scripts were useful but fragile and dependent on institutional knowledge. - As operational demands grew, Discord created the Scylla Control Plane, or SCP, to provide a more structured automation system. ## Shadow Clusters for Safer Upgrades - Shadow clusters are temporary, full replicas of production that receive the same reads and writes as live traffic. - They allow Discord to detect upgrade problems under realistic load before changing production. - Building one manually requires: - Provisioning and configuring nodes - Joining nodes to the cluster - Validating replication - Establishing dual-write pipelines - Eventually tearing the environment down - Repeating this process across every ScyllaDB cluster made automation essential, especially for testing operating-system, hardware, and ScyllaDB version changes. ## Lessons from the Previous Automation Discord identified three major weaknesses in its old scripts: - **Unsafe:** Scripts could be run against the wrong nodes or in the wrong order, often without precondition checks. - **Unrecoverable:** A failure late in a multi-step process required restarting from the beginning. - **Difficult to extend:** New operations often required copying and modifying existing scripts instead of composing reusable components. SCP was designed around four goals: - Provide an extensible task framework that hides orchestration complexity. - Support configurable parallelism, including constraints such as avoiding simultaneous work in different availability zones. - Make safety the default through preconditions, retries, and persisted state. - Deliver functionality incrementally and refine it through real-world use. ## SCP’s Task-Based Architecture - SCP is organized around **tasks, workflows, and jobs**. - A task represents one unit of work, such as draining a node, checking repair status, or running cleanup. - **Node tasks** operate on individual nodes. - **Cluster tasks** coordinate operations across an entire cluster and may run node tasks across many nodes. - SCP also uses **conditions**, which pause execution until a required state is reached. - Conditions poll ScyllaDB APIs or Prometheus metrics. - They either succeed when the criterion is met or fail after a timeout. - For example, after restarting a node, SCP can wait for compactions to settle before continuing. - This avoids unreliable fixed-duration sleeps and reduces the risk of creating cascading pressure during rolling operations. ## Practical Recommendation For large-scale database operations, automation should be built as a reusable, stateful orchestration framework rather than a collection of scripts. Explicit preconditions, observable conditions, retries, controlled parallelism, and resumable state make complex infrastructure changes safer and more repeatable.

discord

Stock Up in the New Rust Shop! Enjoy a Discord-Only 20% Sale on Most Items until 5/21 (opens in new tab)

Discord has launched a Rust Shop that lets players purchase and gift official Rust cosmetics directly through Discord. The integration is available through the Discord Shop and official Rust server, with purchases delivered to linked Rust inventories. Nearly all official Rust skins released before 2026 are 20% off exclusively on Discord through May 21, 2026. ## Rust Shop Launch - Players can buy official Rust decor, cosmetic sets, and item skins through: - The Discord Shop’s “Game Shops” section - The new “Game Shop” area in the official Rust Discord server - This is the first time Rust supports gifting official skins. - The launch discount applies to nearly every officially made Rust skin released before 2026. ## Purchasing Rust Items - The Rust Shop is currently available only on Discord’s desktop and web apps. - Purchases are delivered directly to the player’s Rust inventory. - Players with already-linked Rust and Discord accounts can use the shop immediately. - Unlinked accounts can be connected after checkout in a few steps. ## Gifting Through Discord Wishlists - Users can view a friend’s Discord Wishlist to see which Rust items they want. - Items can be gifted from: - A friend’s Wishlist - Direct messages using the gift icon - The Rust Shop - Rust item links shared in chat - While watching someone stream Rust - The feature makes it easier to choose appropriate cosmetics without guessing. Take advantage of the Discord-exclusive 20% discount before it ends on May 21, while purchasing or gifting Rust items through the desktop or web versions of Discord.

discord

Discord Patch Notes: May 4, 2026 (opens in new tab)

Discord’s May 4, 2026 patch focuses on reliability, performance, usability, and server administration. Major improvements include nearly 5% faster Android video startup, reorganized desktop settings, faster Soundboard access, and self-updating Linux support. The release also fixes numerous bugs across account profiles, search, payments, moderation, notifications, and mobile platforms. ## Performance and Platform Improvements - Android video startup improved by 4.89%, bringing average feed startup time below 600 milliseconds. - Soundboard data now loads when users join a voice channel rather than when they first open the Soundboard, reducing initial access time. - Linux now uses Discord’s Rust-based automatic updater, eliminating the need for manual update installation. - Linux installation now supports `.rpm` and `.pkg.tar.zst` packages. ## Server Administration and Moderation - Discord fixed several issues affecting server administrators and moderators. - Fixes covered permissions, user states, and interactions with account-safety systems. - Discord encouraged administrators to report remaining problems through its community bug megathread. ## Desktop Settings and Organization - Desktop settings were consolidated into three pages: - Appearance - Accessibility - Developer - The former Appearance, Accessibility, Chat, Streamer Mode, and Advanced sections were reorganized. - Several settings received clearer wording and improved layouts. - Fixed problems involving theme synchronization, profile editing, unsaved-change warnings, currency labels, and server administration prompts. ## General User Interface Fixes - “GODLIKE!!” and “BEYOND GODLIKE!!” copy-username messages now have opaque backgrounds. - The Quick Switcher can now accept invite links, join the associated server, and navigate to it. - Fixed display problems involving long nicknames, search filters, avatar controls, profile links, status indicators, and Nitro badges. - French users can now search for “sondage” without the search term being incorrectly split. - Android search filters now correctly display their active blue state. - Fixed several modal, button-spacing, and navigation issues across desktop and mobile. ## Profiles, Avatars, and Customization - Per-server avatar links now copy correctly instead of copying the main profile avatar link. - Clearing per-server pronouns no longer repopulates them from the main profile; the main pronouns appear only as a placeholder. - iOS no longer switches unexpectedly to a per-server profile after copying a username. - Recent-avatar delete controls now appear correctly. - Custom Status editing opens above the full profile instead of replacing it. - Fixed an issue where clicking outside profile editing discarded changes without warning. ## Notifications, Search, and Media - Desktop Inbox no longer crashes when many notifications are cleared rapidly. - Mobile search tabs for Media, Pins, Files, and Links no longer spam errors or retry repeatedly after a connection loss. - Expired public image links in the Inbox preview now behave more reliably. - Fixed an issue where long mobile search-result nicknames obscured timestamps. ## Payments and Server Boosting - Server Boost marketing audio now stops when users enter the purchase flow. - Pressing Escape during payment no longer closes the underlying Server Boost page instead of the payment window. - Nitro trial recipient checkboxes now select friends correctly. - Fixed overlapping controls in Profile Settings and spacing issues on the domain-connection page. - GBP subscription settings now show the currency’s full name. Discord’s changes combine small interface corrections with measurable performance and platform improvements. Users should receive the fixes progressively, since deployment may still be rolling out across platforms.

cloudflare

Making Rust Workers reliable: panic and abort recovery in wasm‑bindgen (opens in new tab)

Rust Workers historically treated Rust panics and aborts as fatal WebAssembly failures, potentially poisoning a Worker instance and causing unrelated requests to fail. Cloudflare’s latest work upstreamed into `wasm-bindgen` adds comprehensive recovery: `panic=unwind` preserves application state after recoverable panics, while abort handling ensures Rust code cannot run again after an unrecoverable abort. ## Initial Recovery Mitigations - Early Rust Workers used a custom panic handler to track failures and reinitialize the entire application before serving later requests. - JavaScript bindings were wrapped with Proxy-based indirection so every Rust entry point passed through recovery logic. - Generated bindings were modified to reinitialize the WebAssembly module after failures. - This approach shipped by default in `workers-rs` 0.6 and prevented persistent failure modes, but reinitialization could discard in-memory state. ## Panic Unwinding with WebAssembly Exception Handling - WebAssembly’s `wasm32-unknown-unknown` target traditionally defaults to `panic=abort`, turning panics into traps and `WebAssembly.RuntimeError` exceptions. - With WebAssembly Exception Handling support, Rust can be compiled using: ```bash RUSTFLAGS='-Cpanic=unwind' cargo build -Zbuild-std ``` - Unwinding allows Rust destructors to run, preserving state and cleaning up resources instead of terminating the entire instance. - `std::panic::catch_unwind` can translate a Rust panic into a recoverable `Result`. ## Changes to wasm-bindgen - The Walrus WebAssembly parser was updated to understand `try`/`catch` exception-handling instructions. - The descriptor interpreter was updated to evaluate code containing exception blocks. - Generated exports now catch Rust panics at the Rust–JavaScript boundary and expose them as `PanicError` exceptions. - Async exports reject their JavaScript promises with `PanicError`. - Exported functions use `extern "C-unwind"` so unwinding is explicitly permitted across the boundary. - A `MaybeUnwindSafe` trait checks `UnwindSafe` requirements only when compiling with `panic=unwind`. - For closures that cannot safely unwind, `Closure::new_aborting` provides an explicit alternative that terminates on panic rather than risking invalid state. ## Results of `panic=unwind` - Panics in exported Rust functions are caught by `wasm-bindgen`. - JavaScript receives a `PanicError`. - Async calls reject their promises instead of poisoning the Worker. - Rust destructors execute correctly. - The WebAssembly instance remains valid and reusable. - Stateful applications, including Durable Objects, can recover without losing all in-memory state. ## Abort Recovery - `panic=unwind` cannot handle aborts such as out-of-memory failures because aborts do not unwind. - The remaining recovery mechanism prevents Rust code from being re-entered after an abort, avoiding repeated execution in a corrupted WebAssembly state. - Together, unwinding and abort recovery prevent one failed request from poisoning sibling or future requests. The recommended approach is to use the latest `wasm-bindgen` and Rust Workers releases, enabling `panic=unwind` where state preservation matters while using explicit aborting closures when unwind safety cannot be guaranteed.

cloudflare

Unweight: how we compressed an LLM 22% without sacrificing quality (opens in new tab)

Unweight is Cloudflare’s lossless compression system for LLM weights, reducing model size by 15–22% while preserving bit-exact outputs. It targets the memory-bandwidth bottleneck in GPU inference by compressing weights in HBM and decompressing them directly into fast on-chip memory before tensor-core computation. On Llama-3.1-8B, the approach saves roughly 3 GB of VRAM and enables more models to run per GPU. ## The GPU Memory Bottleneck - LLM inference is often limited by memory bandwidth rather than computation. - Each generated token requires reading the model’s weights from GPU high-bandwidth memory (HBM). - NVIDIA H100 tensor cores can process data far faster than HBM can supply it. - Smaller weights reduce the amount of data transferred across the memory bus. - Decompression must be carefully integrated: if it adds latency that cannot overlap with matrix multiplication, token generation becomes slower. ## Why Lossless Compression Matters - Quantization commonly converts 16-bit values into 8- or 4-bit integers. - Because quantization is lossy, it can change model behavior and response quality unpredictably. - Unweight instead preserves exact outputs and does not require specialized hardware. - Existing systems were unsuitable because they focused on CPU decompression, custom FPGA hardware, or consumer GPUs rather than Hopper-generation GPUs and production inference. ## Compressing BF16 Weights - BF16 values contain: - A sign bit - An 8-bit exponent - A 7-bit mantissa - Sign and mantissa values appear largely random and are difficult to compress. - Exponents are highly predictable: the 16 most common exponent values account for more than 99% of weights in a typical layer. - Unweight applies Huffman coding to exponent bytes while leaving sign and mantissa bits unchanged. - Rare exponents are handled by storing an entire row of 64 weights verbatim, avoiding per-element branching during decoding. ## Selective Compression of Model Layers - Unweight compresses the MLP gate, up, and down projection matrices. - These matrices represent roughly two-thirds of model parameters and generate substantial memory traffic during decoding. - Attention weights, embeddings, and layer norms remain uncompressed. - The exponent compression produces about 30% savings in the targeted streams and approximately 20% reduction in total MLP weight size. - Overall model-size reductions reach 15–22%. ## Direct GPU Decompression - Model weights normally reside in large but slower HBM and are staged into small, fast shared memory before computation. - Conventional approaches decompress full matrices back into HBM and then run standard matrix multiplication, creating additional memory traffic. - Unweight decompresses weights in shared memory and feeds them directly to tensor cores. - Different execution strategies are used depending on the weight matrix and batch size. - An autotuner selects the fastest strategy for each workload. ## Results and Availability - Tests on Llama-3.1-8B achieved: - Around 30% compression for MLP weights - 15–22% reduction in total model size - Approximately 3 GB of VRAM savings - The savings allow more models to fit on each GPU, potentially reducing inference cost and improving global deployment coverage. - Cloudflare is publishing a technical paper and open-sourcing the GPU kernels. Unweight demonstrates that lossless, inference-time compression can improve GPU utilization without changing model behavior. The practical recommendation is to compress the portions of a model that dominate memory traffic while integrating decoding directly into the GPU execution path.