❌

Reading view

Manta rays inspire a smarter algorithm for cleaner, cheaper power grids

Every time a power grid operator decides how much electricity each generator should produce, a quiet balancing act takes place. Burning less fuel saves money, but it often means allowing more pollution, and cutting emissions usually drives costs up. Engineers have long searched for a way to satisfy both goals at once, a challenge known as combined economic emission dispatch, or CEED. Now, a team of researchers has turned to one of the ocean’s most graceful feeders, the manta ray, for inspiration, and the result is an optimization algorithm that outperforms a crowded field of competitors on both cost and cleanliness.

The study, published in the journal Results in Engineering by Yu-Feng Sun, Jie-Sheng Wang and colleagues, describes an enhanced version of the Manta Ray Foraging Optimization algorithm, or MRFO. The original algorithm, first introduced a few years ago, mimics the cooperative hunting strategies that manta rays use to harvest plankton. Because plankton drifts unpredictably with seasons and weather, manta rays have evolved three distinct foraging behaviors: chain foraging, in which animals line up in arcs so that each one catches food missed by the one ahead; spiral foraging, where the group coils around a dense patch of food; and somersaulting, in which individuals flip back and forth around a promising spot. Translated into mathematics, these behaviors become rules that move a population of candidate solutions around a search space, gradually converging on the best answer.

What makes the CEED problem so stubborn is its mathematical character. The relationship between a generator’s output and its fuel consumption follows a cubic curve, and the emissions of carbon dioxide, nitrogen oxides and sulfur dioxide each follow their own cubic functions. The combined objective is nonlinear, nonconvex and discontinuous, riddled with local minima that can trap classical techniques such as lambda iteration or gradient-based methods. To make matters harder, the problem is genuinely multi-objective, so the researchers converted it into a single objective by applying price penalty factors that fold the cost of each pollutant into one total figure in dollars per hour.

Constraint handling is where many algorithms stumble. Traditional approaches add a fixed penalty whenever a solution violates the power balance requirement, the equation demanding that total generation minus transmission losses equals demand. But a fixed penalty is a blunt instrument. Set it too low and the algorithm happily returns infeasible schedules; set it too high and the search becomes so restricted that it cannot explore properly. Finding the right value through trial and simulation is time-consuming and inefficient. The team’s answer was to make the penalty itself dynamic, drawing on five different mathematical functions: sinusoidal, hyperbolic tangent, arctangent, linear and hyperbolic secant. Each function is raised to an order that changes during the run, so the penalty strength adapts to both the size of the violation and the stage of the optimization. Early on, mild penalties preserve exploration; later, penalties tighten to push solutions toward feasibility.

The second major innovation targets the heart of the MRFO algorithm. In the original design, a parameter called C governs the switch between exploration, casting the net wide across the search space, and exploitation, homing in on the best solution found so far. This parameter rises monotonically from zero to one, a predictable march that can leave the algorithm poorly balanced at certain stages. The researchers replaced it with a chaotic switching factor, drawn from nine well-known chaotic maps including Chebyshev, logistic, tent, sine, Gauss and singer maps, combined with an exponential adjustment function. The result is a parameter that still trends upward but oscillates along the way, periodically reopening the search space and preventing the population from settling prematurely into a local optimum.

To find out which chaotic map worked best, the team ran all nine enhanced variants, named C1MRFO through C9MRFO, through the CEC-2022 benchmark suite of twelve test functions, using a population of thirty and five hundred iterations averaged over thirty independent runs. The Chebyshev-based variant, C1MRFO, emerged as the overall winner, ranking first among the nine and beating the original MRFO, which finished last. Wilcoxon rank-sum tests confirmed that most of the improvements were statistically significant, with p-values below the conventional 0.05 threshold. When C1MRFO was pitted against a roster of state-of-the-art metaheuristics, including the dhole optimization algorithm, evolutionary mating algorithm, dung beetle optimizer, snow geese algorithm, particle swarm optimization, grey wolf optimizer, sparrow search algorithm and marine predators algorithm, it achieved the best final rank, taking first place on many of the test functions while keeping computational times competitive.

The real test, however, came when the algorithm was applied to actual dispatch problems. The researchers simulated a six-unit power system under four load demands of 150, 175, 200 and 225 megawatts. Across all four scenarios, C1MRFO produced the lowest comprehensive total cost, which combines fuel cost with the weighted penalties for carbon dioxide, nitrogen oxide and sulfur dioxide emissions. At 150 megawatts, for example, it reached a total cost of about 10,137 dollars per hour, edging out the grey wolf optimizer and clearly beating algorithms such as the arithmetic optimization algorithm, Harris hawks optimization, whale optimization algorithm, sine cosine algorithm, particle swarm optimization and the lambda iteration method. The pattern held at every load level, with the margin over the weakest classical method growing to thousands of dollars per hour at 225 megawatts.

The dynamic penalty functions delivered a further, striking gain. When the sinusoidal penalty function was applied with the parameter order set to dy5, the total cost at 150 megawatts dropped from roughly 10,137 to 9,065.71 dollars per hour, and similar reductions appeared at the higher loads, reaching 14,621.45 dollars per hour at 225 megawatts. Comparing the five penalty shapes, the sinusoidal function consistently produced the lowest minimum costs, beating the hyperbolic tangent, arctangent, linear and hyperbolic secant alternatives by margins ranging from hundreds to nearly two thousand dollars per hour depending on the load. Notably, when the penalty order was fixed rather than dynamic, performance was worst across the board, confirming that the adaptivity of the penalty, not merely its presence, is what matters.

To verify that each improvement contributes on its own, the team conducted an ablation study on a much larger twenty-unit system with a total demand of 2,500 megawatts. The results formed a clear hierarchy: the original MRFO achieved 61,835.16 dollars per hour, the chaos-enhanced C1MRFO reached 61,826.11, and the fully improved version combining chaos with the optimal sinusoidal dynamic penalty, sin(dy5)MRFO, achieved the best figure of 61,807.36 dollars per hour. All three outperformed the phasor particle swarm optimization benchmark, which came in at 61,895.57 dollars per hour. The stepwise improvement demonstrates that the two enhancements are not redundant but superimpose their benefits, and that the framework scales to systems far larger than the six-unit case.

The authors are careful to note where the work goes next. The current approach converts the multi-objective problem into a single objective through price penalty factors, but future versions could adopt Pareto-based multi-objective optimization to generate full sets of non-dominated trade-off solutions. The test cases also assume deterministic demand, so extending the algorithm to stochastic dispatch with wind and solar integration is another goal, as is combining the dynamic penalty with feasibility-first constraint-handling strategies. For now, the study offers a compelling demonstration that borrowing the foraging logic of a filter-feeding fish, perturbing it with chaos, and teaching it to calibrate its own punishments can squeeze meaningful savings and emission reductions out of one of power engineering’s hardest scheduling problems.

Subject of Research: An improved manta ray foraging optimization algorithm with chaotic switching factors and dynamic penalty functions for solving the combined economic emission dispatch problem in power systems.

Article Title: Manta ray foraging optimization algorithm with dynamic penalty function and chaos switching factor to solve combined economic emission dispatch problem

Article References: Sun, Y.-F., Wang, J.-S., Zhang, X.-Y., Li, Y.-X., Guan, X.-Y., & Liu, X. (2026). Manta ray foraging optimization algorithm with dynamic penalty function and chaos switching factor to solve combined economic emission dispatch problem. Results in Engineering, 32, Article 113383. https://doi.org/10.1016/j.rineng.2026.113383

Image Credits: AI Generated

DOI: Not provided

Keywords: manta ray foraging optimization, combined economic emission dispatch, metaheuristic algorithms, chaotic maps, dynamic penalty function, power system optimization, emission reduction, fuel cost minimization, CEC-2022 benchmarks, swarm intelligence, constraint handling, Results in Engineering

  •  

AI Paints Building Schedules Out of Noise, Cutting Energy Use by Nearly 29 Percent

Buildings are responsible for an enormous share of global electricity demand, and the way their air conditioners, lights, and heating systems are scheduled can make the difference between a grid under strain and one running smoothly. For years, engineers have tried to optimize these schedules with evolutionary algorithms and reinforcement learning, but the problem becomes brutally hard when dozens of buildings share a single electrical network and must be coordinated simultaneously. A new study published in Discover Artificial Intelligence proposes a strikingly different approach: instead of searching step by step for the best schedule, a generative artificial intelligence model learns to paint one directly out of pure noise, guided by a map of how the buildings are physically wired together.

The framework, called DMCBO, short for Diffusion-driven Multi-objective Collaborative Optimization for Building Clusters, was developed by Yalan Zheng of Zhengzhou Technical College and Taixiang Yin of North China University of Water Resources and Electric Power. Their central insight is that the joint scheduling of equipment settings and load distribution across an entire cluster of buildings can be treated as a high-dimensional data sample, much like an image. Diffusion models, the same family of generative techniques behind modern text-to-image systems, work by progressively corrupting data with Gaussian noise and then learning to reverse that corruption. The researchers reformulated multi-objective building optimization as exactly this kind of conditional denoising process: starting from random noise, the model strips away noise step by step until a complete, Pareto-optimal collaborative schedule for every piece of equipment in every building emerges.

Technically, the forward diffusion process is a fixed Markov chain that adds tiny amounts of Gaussian noise to real scheduling data over one hundred steps, with the noise coefficient increasing linearly from 0.0001 to 0.02 until the original data becomes indistinguishable from standard Gaussian noise. A neural network is then trained to predict the noise that was added at each step, given the noisy schedule and a conditional encoding vector describing the current situation. Once trained, the model can generate fresh solutions at inference time by sampling pure noise and running the reverse process, refining it over one hundred denoising steps into a schedule tailored to the prevailing weather, occupancy, and grid conditions. Because this generation is a gradient-based learning process rather than an iterative search, it avoids the local optima traps that plague traditional multi-objective evolutionary algorithms and the reward oscillations that destabilize deep reinforcement learning.

What makes the system genuinely cluster-aware is its use of graph neural networks. The researchers model the building cluster as a graph mapped onto a radial distribution microgrid topology, where nodes represent buildings and edges encode physical constraints such as maximum line thermal capacities and transformer limits. A two-layer graph convolutional network passes messages between neighboring buildings, fusing spatial-topological dependencies and network constraints into a single graph embedding. This embedding is concatenated with an adjustable preference weight vector to form the condition that steers the denoising trajectory. In effect, when the model generates a control strategy for one building, it simultaneously perceives the state of its neighbors and the limits of the shared electrical infrastructure, suppressing systemic coordination errors from 0.18 down to 0.06 in the team’s experiments.

The multi-objective aspect is handled through an elegant scalarization trick. Each objective, such as energy consumption, operating cost, or thermal comfort, is normalized to a dimensionless value between zero and one using Min-Max normalization based on historical operational bounds. The normalized objectives are then blended into a single scalar condition via a weight vector whose components sum to one. During training, these weights are sampled from a uniform Dirichlet distribution, exposing the model to the entire space of possible preferences so it learns the distribution of the full Pareto front. At deployment, a decision maker can slide the weight vector like an adjustment knob, instantly generating schedules that emphasize energy saving, comfort, or a balanced compromise, all within the same trained model.

The denoising backbone itself is a U-Net adapted to process one- and two-dimensional building scheduling tensors. Diffusion time steps are embedded through sinusoidal positional encodings, while the graph-derived condition is injected into every residual block via Adaptive Layer Normalization. A bottleneck layer with multi-head self-attention captures long-range dependencies across the entire daily scheduling horizon, and symmetric skip connections preserve high-resolution information during reconstruction. The authors trained the model for 300 epochs on dual NVIDIA Tesla V100 GPUs, and the loss curves dropped from 0.75 to below 0.03 with training and validation curves closely coinciding, indicating no overfitting. As the reverse diffusion step count decreased from 90 to 10 during analysis, the noise-prediction error distribution became sharply concentrated at zero, demonstrating extremely high denoising precision at the end of generation.

Validation was carried out on the open-access Building Data Genome Project 2 dataset, which supplied real hourly weather records, operational schedules, and annual electricity, cooling, and heating load profiles across diverse climate zones. Because that dataset provides metered energy data rather than physical building models, the team used United States Department of Energy Commercial Reference Buildings as templates and calibrated them in EnergyPlus, a high-fidelity thermodynamic simulation platform, to create a digital twin consistent with the real data. All results were benchmarked against a rule-based control strategy with static thermostat setpoints of 25 degrees Celsius in summer and 22 degrees in winter, and every experiment was repeated ten independent times to confirm statistical significance.

The headline numbers are impressive. In high-demand summer conditions, DMCBO achieved an average energy-saving rate of 28.6 percent and cut peak load by 38.5 percent, shaving the afternoon peak from roughly 560 kilowatts down to about 440 kilowatts and saving approximately 142.80 US dollars per day. Cumulative daily power savings exceeded 1,000 kilowatt-hours, compared with 400 kilowatt-hours for a traditional collaborative strategy and just 120 kilowatt-hours without coordination. In winter, peak shaving and valley filling reached about 39 and 42 percent respectively, far above the 22 and 25 percent of conventional methods. When the solution sets were projected into objective space, DMCBO dominated the baselines: it reached a hypervolume indicator of 0.95 within 12,000 function evaluations, versus 0.85 for NSGA-II and 0.70 for MOPSO, while keeping operating costs between 140 and 160 dollars against more than 210 dollars for deep reinforcement learning and 260 to 300 dollars for a GAN-based generative approach.

Robustness and scalability proved equally compelling. Under injected stochastic disturbances mimicking sudden weather changes and occupancy swings, the framework confined power fluctuations to a narrow band of plus or minus 5 kilowatts, whereas the deep reinforcement learning baseline swung between minus 15 and plus 20 kilowatts. Scaling from 5 to 50 buildings, the global energy-saving rate actually rose from 28.5 to 31.2 percent, because larger clusters unlock more load-complementary opportunities that the graph encoder can safely exploit within encoded grid boundaries. Computation time grew to 9.8 seconds at the 50-building scale, but that remains comfortably within the 15-minute control horizon used by real building management systems, and the hypervolume index slipped only slightly to 0.88. Ablation experiments confirmed that both the graph neural network module and the choice of 100 diffusion steps, which yields a 50-millisecond inference latency, were essential to this balance of speed, accuracy, and stability.

The authors are candid about limitations. The framework has so far been validated only in simulation, and EnergyPlus simplifies sub-minute mechanical actuation latencies that real HVAC hardware would introduce; they propose cascading PID loops and predictive safety margins to absorb those delays in practice. Data quality, generalization to residential buildings and extreme climates, the computational cost of scaling to city-sized networks, and the black-box nature of the generative process all remain open challenges, with explainable AI and transfer learning flagged as future work. Still, the architecture is designed to slot into standard building management systems as a supervisory layer, transmitting setpoints over protocols such as BACnet or Modbus. If the simulation gains survive contact with physical buildings, the idea of generating optimal energy schedules from noise, guided by a graph of the grid itself, could become a powerful new tool in the push toward decarbonized cities.

Subject of Research: Conditional diffusion models with graph neural networks for multi-objective energy optimization in building clusters

Article Title: Diffusion model-driven multi-objective collaborative optimization for building energy management using graph neural networks

Article References: Zheng, Y., & Yin, T. (2026). Diffusion model-driven multi-objective collaborative optimization for building energy management using graph neural networks. Discover Artificial Intelligence, 6(1), Article 1383. https://doi.org/10.1007/s44163-026-02140-z

Image Credits: AI Generated

DOI: 10.1007/s44163-026-02140-z

Keywords: diffusion models, graph neural networks, building energy management, multi-objective optimization, EnergyPlus, smart buildings, Pareto optimization, deep learning, energy efficiency, HVAC control, microgrids, generative AI

  •  

Testing Tip: Make Your Keyboard Fast

Marcin Wichary:

By default, on a Mac, the initial delay is 500ms, and the key repeat rate 1000ms.

[…]

My suggestion is to make them both as short as possible for testing.

[…]

First, it’s good to test whether your keystrokes behave well when repeated. Occasionally you might want your interface to suppress repeating, or do something special if the key is held longer.

Second, it’s a good test not just of repeating, but just the user pressing keys really fast.

Previously:

  •  

Mojo 1.0

Modular (tweet, beta, Hacker News):

Today, the Mojo language officially reaches 1.0: a milestone the language has been building toward since its first release in 2023. Mojo has grown into a general-purpose language with a vibrant developer community writing their own libraries, tools, and applications on top of it. With Mojo 1.0, developers can now build for the long-term on a stable, production-ready language foundation.

[…]

Importantly, Mojo 1.0 does not mark the end of the language’s evolution, but it is an important milestone on a longer journey. During the 1.x timeframe, changes should primarily be additive, giving developers confidence that the language will not continually shift beneath them. Breaking changes may still be made, but will be managed with care, following the standards of how mature languages (e.g. C++) evolve over time.

Modular (Hacker News):

We are happy to announce that the Mojo🔥 language is now fully open source under the Apache 2.0 license (with LLVM exceptions)! The source code for the Mojo compiler, tooling, and everything else you need to build the language are now available in our modular GitHub repository.

[…]

The Mojo standard library has been accepting contributions since 2024, and we’re grateful for everyone that has helped advance the language. One learning (particularly in today’s era of AI coding) is that we need to be deliberate about how we handle contributions. As such, we aren’t ready to take contributions to the compiler and tooling. We aim to accept contributions to the compiler and tooling by the end of this year, and we’ll share more details when we can.

Abdul Dakkak, Chris Lattner, and Jeff Niu (2023):

This talk will give an overview of Mojo 🔥, a new programming language in the Python family built on MLIR and LLVM. Mojo aims to bridge the programmability and performance gap in systems programming by combining Python’s ergonomics and ecosystem with C++ and CUDA-level performance into a single language. We will describe how Mojo leverages the MLIR and LLVM infrastructures to provide meta-programming, user-defined code transformations, hardware backends, adaptive compilation, and auto-tuning to enable developers to achieve performance without sacrificing programmability.

Gergely Orosz (2025, tweet):

Chris Lattner is one of the most influential engineers of the past two decades. He created the LLVM compiler infrastructure and the Swift programming language – and Swift opened iOS development to a broader group of engineers. With Mojo, he’s now aiming to do the same for AI, by lowering the barrier to programming AI applications.

I sat down with Chris in San Francisco, to talk language design, lessons on designing Swift and Mojo, and – of course! – compilers.

See also: LPython (Hacker News).

Previously:

  •  

MacVoices #26177: Flip The Script – Vladyslav Hamolia On MacPaw’s AI Assistant, Eney

At Flip The Script in San Francisco at WWDC, Vladyslav Hamolia, AI Staff Engineer for MacPaw.discusses the company’s push to become AI-first by rethinking existing products, building internal tools, and supporting third-party vendors. He profiles Eney, the MacPaw AI assistant (available in Setapp) designed to perform tasks, optimize workflows, and improve daily routines. It addresses security while balancing local-first privacy goals with hybrid cloud models. 

💾

  •  

SpamSieve 3.3.1

SpamSieve 3.3.1 is an update of my Mac e-mail spam filter that improves the filtering accuracy and includes various optimizations, fixes, and updates for macOS 27. Some interesting engineering issues were:

  • I’m still supporting macOS 10.13, but the app can now build with the macOS 12 deployment target in preparation for Xcode 27. The way Swift handles calling deprecated APIs remains annoying. You need workarounds like protocols to suppress a warning in a particular region of code. Often, I am updating to a newer API, but I want to continue using the old one on earlier versions of macOS. Right now I am heavily testing on macOS 26, so I would like to only deploy the new code there. Sometimes the initial versions of APIs are buggy, and I don’t want to have to retest every feature on every version. But Swift doesn’t like me to gate the calls to macOS 26 and later if the new API was actually introduced in, say, macOS 11.

  • The most risky update was probably switching to the Swift API for Scanner. This is tricky because the current scan position changes from being based on UTF-16 indexes to String.Index. And in some cases my code was intentionally scanning into the middle of a combining character. I was really glad to have extensive tests here.

  • Recent versions of Tahoe introduced a Core Data bug that broke save recovery (when invalid Unicode can’t be written to the database and we have to fix it up first). When the error comes in, SpamSieve looks under the NSDetailedErrorsKey key, but the value of this key is "NSDetailedErrorsKey" while the actual error info is under the key "NSDetailedErrors".

  • Database corruption combined with a Core Data bug and two Swift behaviors were causing crashes. The root problem, I think, is that in this situation Core Data neglects to set the error pointer for -[NSManagedObjectContext countForFetchRequest:error:]. Normally, Swift would detect this and throw a generic nilError. However, this method signals errors by returning NSNotFound instead of nil. It’s annotated as swift_error(nonnull_error), which I think means that Swift doesn’t even look at the return value, only the (unset) error. So my code was receiving NSNotFound on the non-error path, treating it as a real count, and doing some math with it, which (by default in Swift) leads to a crash if there’s overflow. Now my code checks for NSNotFound and uses Int.addingReportingOverflow().

  • I reimplemented Core Data batch fetching because of two problems with the fetchBatchSize option. First, it logs spurious errors when fetching from multiple stores at once. Second, it leads to high memory use. It will load objects in batches, but it never releases the earlier batches. You can manually refault objects that you no longer need, but it will still hold onto the full object shells, which can add up. My implementation only holds onto IDs, and it can fetch the IDs using a different context than the objects to push more work to background threads.

  • I’m now using String.makeContiguousUTF8() in various places to avoid slow iteration of bridged strings.

  • There was a regression where some menu code could crash on macOS 10.13. -[NSMenu setItemArray:] is only available on macOS 10.14 and later, whereas the getter is always available. With old Objective-C, the two methods could be annotated with separate availabilities. The Objective-C property syntax doesn’t allow this, so there’s no way for the compiler to flag calls where the setter is missing.

  • The AppleScript support works much better with large data sets. The key, I think, is to never return an array to Cocoa for a scripting property/element. First, if you give it a lazy array it will sometimes try to access all the elements even if it only needs a few. And, second, AppleScript will run out of memory if the array is too large. By using indexed accessors, you can maintain laziness and only convert one object to a descriptor at a time. By caching a batch-fetching collection, you can limit the number of fetches and respond quickly when AppleScript requests individual objects.

Previously:

  •  

Swift 6.4

Swift 6.4 is now available in beta form with Xcode 27. The Swift Evolution proposals are listed here.

What’s new in Swift:

Discover the latest language advancements, including updates for everyday ergonomics, improved concurrency, and safer high-performance code. Explore workflow and language interoperability improvements and updates in embedded Swift.

Build real-time apps and services with gRPC and Swift:

Build engaging live experiences with gRPC in your Swift app and backend. gRPC is an open-source RPC framework designed for high-performance, bidirectional streaming APIs. Explore how the gRPC Swift package provides a modern, safe runtime built with Swift concurrency.

Explore numerical computing in Swift with MLX:

Bring NumPy-style computing natively to Swift with MLX Swift. Discover how to eliminate cross-language friction in your machine learning workflows by handling image processing, tensor operations, and neural network training in a single, type-safe environment. Explore the APIs that let you leverage GPU acceleration while enjoying the compiler, tooling, and debugging experience you already know.

Swift Group Lab:

Join us online for a deep dive into WWDC26 with Apple engineers and designers to ask questions, get advice, and follow the discussion about the week’s biggest Swift announcements.

Matt Massicotte:

There’s a voting system. And that means a number of questions weren’t selected. This time I copied those down and I thought it could be fun to take a shot at answering the ones that are more in my area.

Xcode 27 Beta 2 Release Notes:

The Swift dependency scanner has been optimized to avoid redundant setup work and header searches when looking up Clang modules during a single dependency-scan action, substantially improving scanning performance.

As a consequence of this change, every Clang module reachable from a single Swift dependency-scan action must have a unique module name. If two module maps visible to the same scan declare a Clang module with the same name, the scan may report an error.

[…]

System now provides Swift APIs for the C stat, lstat, fstat, and fstatat system calls. This includes a new Stat type with initializers from FilePath, FileDescriptor, or a C string; FilePath.stat() and FileDescriptor.stat() instance methods; and supporting types (FileType, FileMode, FileFlags, UserID, GroupID, DeviceID, and Inode).

Wade Tregaskis:

The final piece of the Prospective Vision for Accessors, this allows for more efficient accessors on structs, in a nutshell.

[…]

Now there’s a safer version of the existing withUnsafeTemporaryAllocation (first introduced in Swift 5.6). It works just like you’d expect. It comes in both “raw bytes” and typed elements versions, just like its unsafe predecessor.

[…]

The new isTriviallyIdentical(to:) method offers a guaranteed-fast way to check two objects for equality. It is essentially an optimised version of the existing equality condition provided by Equatable and the == operator. It’s useful because it guarantees O(1) time complexity, whereas == makes no formal guarantees at all (and for many types is O(N) or worse). But unlike the existing identity comparison operator === – also O(1) – it promises to do more than just tell if two objects are the exact same pointer, and it works on value types (not just reference types).

[…]

These new types generalise the existing patterns of borrowed and mutable references, that have previously existed in Swift in much more restricted forms (e.g. inout parameters are essentially MutableRef parameters, and Span & MutableSpan are array equivalents).

There’s now a built-in function for demangling Swift symbol names, in the Runtime module (that’s bundled with the Swift toolchain, alongside the stdlib etc).

Khoa Pham:

As Apple has aligned OS version numbers across platforms, Swift 6.4 takes the next step by letting you collapse repetitive availability attributes into a single anyAppleOS token.

[…]

There are situations where you need to call a deprecated API while you plan a migration, or audit a critical function for unsafe usage, without letting those concerns bleed into the rest of the project. The new @diagnose attribute handles both cases.

[…]

Some work should complete even after a task is cancelled, like flushing a file to avoid corruption. withTaskCancellationShield wraps a region where Task.isCancelled always returns false.

Antoine van der Lee:

Swift 6.4 implements SE-0493: Support async calls in defer bodies. This is one of those changes that feels obvious once you need it.

[…]

Swift 6.4 improves error handling for unstructured tasks through SE-0520: Discardable result use in Task initializers. The change helps you catch a subtle bug: creating a throwing task and then ignoring its returned task handle.

[…]

Swift 6.4 also implements SE-0530: Async Result Support.

[…]

Swift 6.4 implements SE-0518: ~Sendable for explicitly marking non-Sendable types. It allows you to communicate that a type has been audited and should not conform to Sendable.

Slava Pestov:

I thought it would be a good time to detail some of the type checker performance improvements we worked on since I shared the type checker performance roadmap last year. I’m also going to outline a couple of things we plan on looking at next.

Previously:

Update (2026-07-09): I was optimistic about improvements to the type checker making compilation faster, but I found that compiling my predominantly Swift project with Xcode 27 Beta 3 was only 0.3% faster than with Xcode 26.6. I wonder if there’s some extra setting I’m supposed to enable.

  •  

Rewriting Apple’s TrueType Hinting Interpreter in Swift

Scott Perry:

My team rewrote Apple’s TrueType hinting interpreter in Swift, ask me anything.

[…]

I feel like naming just one would be a disservices to all of the features that made this effort possible (C interop, generics, noncopyable/nonescapable types) but at the end of the day I think the star of the show was the optimizer; despite being faster than the code it replaced, the new code is super readable and that was only possible because the optimizer was able to completely eliminate all of our abstractions.

The new version is faster, but the main motivation was security concerns.

Dmitrii Kalianov:

Is hinting useful/being used in the days of hi-dpi displays? I was under impression that Apple switched to grayscale anti-aliasing and ditched hinting.

Scott Perry:

For the most part hinting isn’t really necessary anymore, but thanks to being Turing-complete it has been Hyrum’s law-ed by at least one CJK font that uses hinting to lay out strokes in its characters.

Alex Rosenberg:

There were three major TrueType implementations at Apple IIRC:

  • The original 68K one
  • A rewrite for Copland that lived with ATS/ATSUI after Copland was cancelled
  • iPhone shipped one derived from heavily-modified FreeType that was current until today

Scott Perry:

One of the axioms for this project was that I wanted my team to write the most boring code possible—nearly identical structurally to the code it was replacing, because to do otherwise would introduce binary compatibility risk. The other axiom was 100% test coverage for all new code as it landed, with the same units testing both interpreters.

Rosyna Keller:

Is the font parsing code itself still C++?

Scott Perry:

There is also a “Safe Font Parser” for WebKit in Lockdown Mode, but it supports a subset of all the myriad features provided by font formats.

Previously:

Update (2026-06-16): Scott Perry (Hacker News):

Font parsers process data from untrusted sources, making the TrueType hinting interpreter a security-critical attack surface. To make the format more resilient on Apple platforms, we rewrote its hinting interpreter from C to memory-safe Swift for the Fall 2025 releases. In addition to memory safety, we also improved performance: on average, our Swift interpreter runs 13% faster than the C interpreter it replaced.

[…]

Binary compatibility was crucial for this project to succeed: existing programs had to continue to function the same as they did before, effectively unaware that a new implementation was in place. This means not just interface compatibility but pixel-identical glyph rendering as well, relative to the C implementation.

[…]

To ensure correctness, we developed two test suites. The first was a unit test suite that can target both implementations, providing exhaustive (99.7%) code coverage for both. This suite is included with the open source release of the Swift interpreter.

Then, to represent real-world workloads, we used a fuzzer to minimize a corpus of 10 million PDF files down to 4,200 without any loss of code coverage.

[…]

Following WebKit’s Safer Swift Guidelines, the example below demonstrates how to wrap a bridged structure from C in a projection type that uses Ref for lifetime safety, brokers bounds-safe access to the underlying data, and returns idiomatic Swift types to its callers.

The interpreter source is on GitHub.

Marcin Krzyzanowski:

@_lifetime(copy code, copy twilightZone, copy glyphZone)

See also: Phillip Tennen’s Writing a TrueType font renderer (Hacker News).

Previously:

  •  

Glow Leopard

Tim Hardwick:

Apple at WWDC 2026 today said it has made several responsiveness improvements across its software ecosystem, speeding up system animations, app launching, and much more.

Zac Hall:

Overall, iOS 27 so far is a major collection of performance improvements and refinements.

Ryan Christoffel:

As had been rumored leading up to today, Apple has spent extra time this year working on bug fixes and performance improvements for iOS 27.

Adam Engst:

Although there’s no obvious connection between the Tahoe and Golden Gate names to indicate a “tock” release, Apple devoted the first chunk of the WWDC keynote to how OS 27 will address user and developer complaints about OS 26.

[…]

Apple also made a big deal about performance improvements, smoothing system animations, launching iPhone and iPad apps up to 30% faster, displaying new photos in the Photo Library up to 70% faster, transferring files via AirDrop up to 80% faster, and moving files from an iPad to an external drive is up to 5x faster, so it compares with macOS transfer speeds. A new CPU Scheduler promises to improve iPhone performance even on older models back to the iPhone 11, which may encourage more people with older iPhones to upgrade.

Kyle Howells:

There really aren’t many changes this year.

I’m way more interested in bug fixes, but optimizations and refinements are great, too. Simply limiting the number of new features creates space to improve the software quality, though, it’s not clear to me whether there are really fewer new features or if it’s just that they mostly fall under the single heading of AI.

Paul Hudson:

Animations run smoother, apps launch faster, and Liquid Glass is better? It’s Glow Leopard for sure!

Divya Ravi:

One underrated theme from this WWDC is Apple investing heavily in fundamentals.

Faster launches, scheduler improvements, search infrastructure, networking transitions, rendering performance…

Users notice responsiveness long before they notice most new features.

Clarko:

You gotta admire Apple’s ability to market “bug fixes and performance improvements” so effectively.

Please just do this every other year.

Previously:

Update (2026-06-12): David Smith:

Something I’ve noticed about performance work is that people really want there to be A Cause for improvements. A new technology, something old no longer holding things back, “removing the debug logging”, etc…

The truth of the matter is that 97% of the time the enabling thing for performance work is engineers having time in the schedule to sit down with the tools (usually a sampling profiler) and grind out small wins over and over.

There’s no magic bullet that replaces good engineering.

It sounds like the magic bullet is a reasonable release schedule. You’ve always had the power, my dear Craig. You just had to learn it for yourself.

Jason Snell:

The moment the keynote used the phrases “sweating the details” and “attention to detail,” it was clear that beyond AI and Siri features, this year is about small fixes and improvements. In more private settings, Apple folks specifically referenced Snow Leopard and iOS 12, two updates that saw Apple take a pause from huge feature roll-outs and prioritize speed and bug fixes a bit more.

But to be clear, referencing Snow Leopard does not mean “no new features.” Like Apple’s 27 releases, Snow Leopard was full of dozens, if not hundreds, of new features—they were just scattered small improvements throughout the system.

Patrick McConnell:

The older I get and the longer I do this development work I realize time is short and we may not get to all the things we want to do in life. So when we are forced to wait yet another year for some fixes to a framework we’ve been trying to use for several yearly cycles already it can be disappointing to say the least.

[…]

Unlike past years there is no clear Apple mandated work. Thank god. I can focus on what I want to build without having to adopt my code to an ill conceived UI update that will be semi-discarded the following year.

Update (2026-06-16): Marcin Wichary:

It’s an impressive list that garnered universally positive reactions, but I have one observation:

  • “Fast” and variants thereof appear on this list 59 times.
  • “Reliable” and similar words appear 22 times.

[…]

It’s not just me. 15 out of 17 bugs listed on the Bugs Apple Loves site are about reliability.

[…]

I just… I would be a lot more excited if the 3:1 ratio of fast-to-reliable on that slide went the other way.

  •  

Climate Change Alters Resource Adequacy Risks and Optimal Wind, Solar Siting

Climate change is poised to reshuffle the reliability problem facing decarbonized power systems, according to a new study that links weather extremes, long-term climate projections, and real-world infrastructure constraints. As grids rely more heavily on wind and solar, they become sensitive not just to the amount of renewable capacity installed, but to where that capacity is sited relative to transmission lines, load centers, and the local meteorological patterns that govern output.

Using high-resolution climate projections at 12-km scale, the researchers examined how future conditions could alter both renewable generation and electricity demand across two distinct US regions: New England and Texas. They then coupled these climate inputs with an optimization model operating at the county level, allowing the team to test how system design choices—particularly spatial siting of wind and solar and the presence of transmission bottlenecks—affect long-run adequacy.

The results suggest a sharp increase in resource inadequacy risk by mid-century. In both regions, climate change can drive prolonged periods of low renewable generation, which occur when meteorological conditions reduce wind and solar output while demand simultaneously rises. For Texas, the study finds the frequency of inadequacy events could increase dramatically—up to fivefold—if planning proceeds using non-climate-informed assumptions.

Crucially, the work shows that these risks are not determined by aggregate capacity targets alone. Fine-scale siting decisions can lock the system into unfavorable “weather-resource–grid” pairings, amplifying periods when local supply falls short and transmission limits prevent imports from compensating.

Yet the study also offers a pathway to resilience. Climate-informed planning can mitigate the emerging adequacy threat at relatively modest cost. Texas, for example, can maintain near-zero marginal investment cost by shifting wind capacity westward, improving alignment with future wind patterns and reducing reliance on constrained transfers.

New England requires a different strategy. The region faces a higher investment need—about a 2.34% increase—achieved through targeted solar and transmission expansion closer to load centers. This approach helps buffer localized shortfalls during future, climate-driven demand and renewable output mismatches.

Overall, the study argues that achieving climate-resilient decarbonization means moving beyond simple build-out schedules. Instead, it calls for high-resolution, climate-aware spatial planning that reveals siting opportunities invisible to coarse models—turning reliability from a static design metric into a dynamic, region-specific forecast problem.

Subject of Research: Climate change and resource adequacy risks in wind/solar grids, including optimal renewable siting
Article Title: Climate change reshapes resource adequacy risks and optimal renewable energy siting in wind and solar energy systems
Article References: Qiu, L., Khorramfar, R., Wang, S. et al. Climate change reshapes resource adequacy risks and optimal renewable energy siting in wind and solar energy systems. Nat Energy (2026). https://doi.org/10.1038/s41560-026-02109-3
Image Credits: AI Generated
DOI: https://doi.org/10.1038/s41560-026-02109-3
Keywords:

  •  

Hasanuddin University Study Shows Bacterial Cellulose for High-Performance Energy Storage

Bacterial cellulose—nature’s own polymer scaffold—is gaining attention as a renewable feedstock for supercapacitor electrodes. With modern devices demanding fast charge, high power bursts, and long cycle life, researchers are searching for electrode materials that combine performance with sustainability.

A new systematic literature review led by Prof. Dahlang Tahir at Hasanuddin University, Indonesia, maps how bacterial cellulose-derived carbon (BCC) is turned into energy-storage electrodes—and why some fabrication paths outperform others. The study synthesizes evidence from the scientific record to clarify which processing choices control electrochemical behavior.

The review focuses on BCC as a precursor to porous carbon. Bacterial cellulose forms a naturally pure, interconnected network of nanoscale fibers, and heat treatment can convert that architecture into carbon structures with tunable porosity—critical for charge storage. The authors emphasize that electrical performance is not just a matter of “making carbon,” but of preserving and engineering the fiber network before carbonization.

Across 49 Scopus-indexed journal articles, the team compares major strategies including direct carbonization, chemical activation to enlarge pore systems, heteroatom doping to modify surface chemistry, and composite fabrication with materials that can add rapid redox (pseudocapacitive) contributions.

A recurring message is the importance of pre-carbonization drying. Freeze-drying appears as the most commonly used approach because it limits collapse of the wet nanofiber structure during water removal. Since pore architecture governs ion access and charge transport, maintaining nanoscale structure can translate into higher effective capacitance.

The review also distinguishes test formats. Three-electrode measurements are frequently reported, but two-electrode devices better represent real supercapacitor operation, where electrode–electrode interactions shape performance.

When processing is optimized, the results point toward a pathway for BCC-based electrodes to rival or surpass commercial activated carbon under comparable conditions. Activation and heteroatom doping generally increase accessible surface area and create additional active sites, while composites often achieve the strongest capacitance by combining electrical double-layer effects with fast surface reactions.

Yet the authors warn that progress is constrained by inconsistent experimental reporting, uneven protocols, and limited mechanistic understanding. To move beyond laboratory demonstrations, they call for predictive design, data-driven structure–performance models, scalable carbonization methods, and robust flexible devices resistant to deformation and humidity.

Subject of Research: Supercapacitor electrodes using bacterial cellulose-derived carbon
Article Title: Bacterial cellulose-derived carbon electrodes for supercapacitors: Fabrication strategies, electrochemical performance, and mechanical properties — A review
News Publication Date: 9 June 2026
Web References: https://doi.org/10.1016/j.est.2026.123044
References: 10.1016/j.est.2026.123044
Image Credits: Lightenoughtotravel from Wikimedia Commons

Keywords

bacterial cellulose; supercapacitors; porous carbon; freeze-drying; chemical activation; heteroatom doping; electrode materials; two-electrode testing; pseudocapacitance; sustainable energy storage

  •  

Metaplasticity Enhances Life-Course Brain Health Strategies

In a groundbreaking advance poised to reshape how we approach brain health across the human lifespan, recent research reveals that integrating the principles of metaplasticity into therapeutic interventions can dramatically enhance their effectiveness. Metaplasticity, often described as the “plasticity of plasticity,” refers to the brain’s dynamic ability to regulate its own synaptic plasticity based on prior activity and environmental inputs. This emerging understanding promises to revolutionize strategies for cognitive enhancement and neurological rehabilitation, offering personalized and adaptive therapies that evolve with the individual’s brain state.

The concept of metaplasticity extends the traditional notion of neuroplasticity, emphasizing that synaptic changes are not static but modulated by previous experiences. This regulatory mechanism ensures that synaptic modifications occur within optimal ranges, preventing the neural circuits from becoming either too rigid or overly malleable. Recognizing this, scientists are now exploring interventions that do more than promote plasticity—they strategically prime the brain’s plastic potential to achieve sustained and balanced neural adaptability.

Life-course brain health is a complex interplay of genetic, environmental, and experiential factors that cumulatively influence neural function. Traditional interventions often apply a one-size-fits-all model, ignoring the fluctuating states of neural readiness and adaptation across developmental stages. By contrast, therapies informed by metaplasticity tailor their application according to the individual’s neurobiological context, potentially enhancing outcomes in cognitive development, neurorehabilitation after injury, and age-related cognitive decline.

The research underscores the importance of timing and context in brain health interventions. Synaptic plasticity is not merely about stimulating neurons but about doing so when they are optimally susceptible to change. This temporal precision is critical during sensitive periods in childhood and adolescence when the brain’s structure and function undergo rapid transformation. Incorporating metaplasticity principles means recognizing these windows of opportunity and adapting interventions to harness the brain’s highest potential for growth and recovery.

Moreover, metaplasticity offers intriguing insights into why certain neurological and psychiatric conditions manifest, persist, or respond variably to treatment. In disorders such as autism spectrum disorder, schizophrenia, and depression, dysregulation of plasticity mechanisms is increasingly implicated. Understanding how metaplasticity governs synaptic strength and flexibility not only facilitates more refined diagnostic frameworks but also guides innovative therapeutic designs that can recalibrate neural networks more effectively.

Neurorehabilitation strategies following traumatic brain injury or stroke stand to benefit immensely from a metaplasticity-informed approach. Current protocols focus heavily on repetitive stimulation or training, but without considering the brain’s shifting landscape of plasticity thresholds. By integrating metaplastic principles, clinicians can optimize the intensity and nature of rehabilitation exercises to coincide with periods when neuronal circuits are most adaptable, potentially accelerating recovery and improving functional outcomes.

This paradigm shift also extends into the realm of aging and neurodegenerative diseases. As brain plasticity declines with age, interventions designed to restore or boost neuroplastic capacity need to be sensitive to the evolving metaplastic state of neural circuits. Targeting these mechanisms might slow cognitive decline, improve memory retention, and enhance quality of life for older adults. Such interventions could include tailored cognitive training paradigms, pharmacological agents, or even non-invasive brain stimulation techniques employed with metaplastic timing considerations.

Critically, the application of metaplasticity in clinical settings demands a robust biomarker framework to assess brain state and plastic potential dynamically. Advances in neuroimaging and electrophysiological monitoring are instrumental in this regard, enabling real-time tracking of circuit responsiveness and guiding intervention adjustments. This precision medicine approach promises not only better therapeutic efficacy but also minimizes adverse effects associated with inappropriate stimulation.

As the scientific community deepens its understanding of metaplasticity, ethical considerations around intervention timing and intensity come into sharper focus. The prospect of manipulating brain plasticity across the lifespan raises questions about long-term consequences, individual variability, and the balance between enhancement and harm. Ongoing research must address these concerns through rigorous longitudinal studies and multidisciplinary dialogues involving neuroscience, bioethics, and patient advocacy.

Education systems may also harness knowledge on metaplasticity to optimize learning processes. By structuring curricula and educational environments that align with periods of heightened neural receptivity, educators can facilitate more effective skill acquisition and cognitive development. This integration of neuroscience and pedagogy represents a transformative step towards personalized learning experiences tailored to the brain’s natural rhythms of plasticity.

The public health implications are profound, as metaplasticity-guided interventions could democratize brain health strategies, making them more accessible and tailored beyond clinical populations. Community programs aimed at mental wellness, resilience building, and cognitive maintenance might incorporate metaplastic principles to maximize their impact, fostering healthier neural aging trajectories and buffering against stress-related neural degradation.

Future research efforts are focused on unraveling the molecular substrates that orchestrate metaplastic adjustments, including intracellular signaling pathways, neurotransmitter systems, and gene expression dynamics. These investigations hold promise for the development of novel pharmacotherapies that target metaplastic regulators, offering precise modulation of neural plasticity in disease states and healthy brains alike.

In conclusion, applying the burgeoning knowledge of metaplasticity marks a profound evolution in brain health interventions. This approach compels a reexamination of how neuroscientists and clinicians conceptualize brain adaptability, emphasizing a lifelong, context-dependent modulation of neuroplastic potential. As this paradigm gains traction, it sets the stage for more refined, effective, and ethically conscious strategies to optimize brain function from infancy through advanced age.


Subject of Research: Life-course brain health interventions and the role of metaplasticity in optimizing therapeutic outcomes.

Article Title: Life-course brain health intervention choices are improved by applying knowledge of metaplasticity.

Article References:
Scher, M.S. Life-course brain health intervention choices are improved by applying knowledge of metaplasticity. Pediatr Res (2026). https://doi.org/10.1038/s41390-026-05183-1

Image Credits: AI Generated

DOI: 10.1038/s41390-026-05183-1

  •  
❌