Selected changesmerged Nov 10, 2026 – Nov 16, 2026
Extract indexedWatchers.allMatchingWatchers iteratorGo · 33 + / 15 −
Introduces 4 new declarations in staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go.
Adds new systems design rather than adjusting what was there. Tests changed with it, with code of their own.
staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go ↗ · 2 files
@@ -1257,24 +1258,41 @@ func (c *Cacher) startDispatching(event *watchCacheEvent) { namespace := event.ObjFields["metadata.namespace"] name := event.ObjFields["metadata.name"]- forEachSelectionKey(namespace, name, triggerValues, supported,- func(scope namespacedName) {- for _, watcher := range c.watchers.scopeWatchers[scope] {- c.watchersBuffer = append(c.watchersBuffer, watcher)- }- },- func(indexValue string) {- for _, watcher := range c.watchers.indexWatchers[indexValue] {- c.watchersBuffer = append(c.watchersBuffer, watcher)+ for watcher := range c.watchers.allMatchingWatchers(namespace, name, triggerValues, supported) {+ c.watchersBuffer = append(c.watchersBuffer, watcher)+ }+}++func (i *indexedWatchers) allMatchingWatchers(namespace, name string, triggerValues []string, triggerSupported bool) iter.Seq[*cacheWatcher] {+ return func(yield func(*cacheWatcher) bool) {+ stopped := false+ yieldWatchers := func(watchers watchersMap) {+ if stopped {+ return }- },- func() {- for _, watchers := range c.watchers.indexWatchers {- for _, watcher := range watchers {- c.watchersBuffer = append(c.watchersBuffer, watcher)+ for _, watcher := range watchers {+ if !yield(watcher) {+ stopped = true+ return
ENH: Series.interval accessor (GH#16401)Python · 113 + / 0 −
Introduces 6 new declarations in pandas/core/arrays/interval.py.
Adds new core implementation rather than adjusting what was there. Tests changed with it, with code of their own.
pandas/core/arrays/interval.py ↗ · 7 files
@@ -2003,3 +2013,102 @@ def _maybe_convert_platform_interval(values) -> ArrayLike: if values.dtype.kind in "iu" and values.dtype != np.int64: values = values.astype(np.int64) return values+++# ---------------------------------------------------------------------+# The Series.interval accessor+++@delegate_names(+ delegate=IntervalArray,+ accessors=["left", "right", "mid", "length", "is_empty", "closed"],+ typ="property",+)+@delegate_names(+ delegate=IntervalArray,+ accessors=["overlaps", "contains", "set_closed"],+ typ="method",+)+class IntervalAccessor(PandasDelegate, PandasObject, NoNewAttributesMixin):+ """+ Accessor object for interval properties of the Series values.++ Provides the endpoints, midpoints and lengths of the intervals, and+ elementwise checks for containment and overlap, each returned as a+ Series aligned with the original. A categorical Series with interval+ categories, such as the result of :func:`cut`, is also supported.++ Parameters+ ----------+ data : Series+ The Series with interval or interval-categorical dtype to which the+ accessor is attached.
Change the span building of paths from first-to-last to chainedRust · 43 + / 4 −
Introduces 3 new declarations in compiler/rustc_parse/src/parser/path.rs.
Adds new language design rather than adjusting what was there. Tests changed with it, with code of their own.
compiler/rustc_parse/src/parser/path.rs ↗ · 4 files
@@ -208,23 +208,35 @@ impl<'a> Parser<'a> { } let lo = self.token.span;+ let mut path_span = None; let mut segments = ThinVec::new(); let mod_sep_ctxt = self.token.span.ctxt(); if self.eat_path_sep() {+ chain_span(&mut path_span, self.prev_token.span); segments.push(PathSegment::path_root(lo.shrink_to_lo().with_ctxt(mod_sep_ctxt))); }- self.parse_path_segments(&mut segments, style, ty_generics)?;- Ok(Path { segments, span: lo.to(self.prev_token.span) })+ self.parse_path_segments_with_path_span(&mut segments, style, ty_generics, &mut path_span)?;+ Ok(Path { segments, span: path_span.unwrap() }) } pub(super) fn parse_path_segments( &mut self, segments: &mut ThinVec<PathSegment>, style: PathStyle, ty_generics: Option<&Generics>,+ ) -> PResult<'a, ()> {+ self.parse_path_segments_with_path_span(segments, style, ty_generics, &mut None)+ }++ fn parse_path_segments_with_path_span(+ &mut self,+ segments: &mut ThinVec<PathSegment>,+ style: PathStyle,+ ty_generics: Option<&Generics>,+ path_span: &mut Option<Span>, ) -> PResult<'a, ()> { loop {
chat: allow TTS model to provide custom text normalizer via jinjaC++ · 929 + / 0 −
Introduces 15 new declarations in common/chat-tts-norm.cpp.
Adds new runtime rather than adjusting what was there. Tests changed with it, with code of their own.
common/chat-tts-norm.cpp ↗ · 7 files
@@ -0,0 +1,864 @@+#include "chat-tts-norm.h"++#include "jinja/runtime.h"+#include "jinja/value.h"++#include <algorithm>+#include <climits>+#include <stdexcept>+#include <string>+#include <vector>++// TTS normalization patterns, see docs/tts-norm-patterns.md for the specification+// keep this file in sync with the python reference: scripts/chat_tts_norm.py++using namespace jinja;++//+// character classes+// they are defined with explicit codepoint ranges, independent of any unicode database version,+// so that the C++ and python implementations agree on every codepoint+//++struct tts_norm_range {+ uint32_t lo;+ uint32_t hi;+};++static const tts_norm_range TTS_NORM_SPACE[] = {+ {0x0009, 0x000D}, {0x0020, 0x0020}, {0x0085, 0x0085}, {0x00A0, 0x00A0}, {0x1680, 0x1680},+ {0x2000, 0x200A}, {0x2028, 0x2029}, {0x202F, 0x202F}, {0x205F, 0x205F}, {0x3000, 0x3000},+};++static const tts_norm_range TTS_NORM_PUNCT[] = {
fix: Do not echo frontend changes released by a hold back to their clientPython · 48 + / 6 −
Introduces 4 new declarations in panel/io/server.py.
Adds new core implementation rather than adjusting what was there. Tests changed with it, with code of their own.
panel/io/server.py ↗ · 3 files
@@ -796,17 +796,58 @@ def wrapper(self, *args, **kwargs): wrapper._panel_tracks_lock = True # type: ignore[attr-defined] return wrapper ++def _tag_held_patch_events(func):+ """+ Records the connection a patch was received on on the frontend+ changes it leaves held on the Document. Bokeh only skips the+ originating connection while the patch is being applied, so when a+ hold dispatches the change later it would otherwise be echoed back+ to the client and revert anything changed there since.+ """+ @wraps(func)+ async def wrapper(self, message, connection):+ try:+ return await func(self, message, connection)+ finally:+ for event in list(self.document.callbacks._held_events):+ if getattr(event, 'setter', None) is self and getattr(event, '_panel_patch_connection', None) is None:+ event._panel_patch_connection = connection+ return wrapper+++def _skip_patch_connection(document_patched):+ @wraps(document_patched)+ def wrapper(self, event):+ connection = getattr(event, '_panel_patch_connection', None)+ if connection is None:+ return document_patched(self, event)+ current = self._current_patch_connection+ self._current_patch_connection = connection+ try:+ return document_patched(self, event)
perf: Reduce pn.cache per-call overheadPython · 350 + / 131 −
Introduces 22 new declarations in panel/io/cache.py.
Adds new framework internals rather than adjusting what was there. Tests changed with it, with code of their own.
panel/io/cache.py ↗ · 2 files
@@ -662,91 +846,126 @@ def decorator(func: Callable[_P, _R]) -> _CachedFunc[Callable[_P, _R]]: with _hash_context(hash_funcs, approximate): closure_key = _closure_key(func) - fallback_fname = uuid.uuid4().hex+ # If the function is defined inside a bokeh/panel application it is+ # recreated for each session, therefore we cache by file, class and+ # qualified function name. Since that is shared by all functions a+ # factory generates we also key on the values the function closes+ # over, and on the settings so that two decorations of one function+ # with e.g. a different ttl or to_disk do not share a cache.+ func_name = func.__name__+ qualname = getattr(func, '__qualname__', func_name)+ module = sys.modules.get(func.__module__)+ fname = '__main__' if func.__module__ == '__main__' else getattr(module, '__file__', None)+ if fname is None:+ fname = uuid.uuid4().hex+ settings = (+ max_items, policy, ttl, to_disk, str(cache_path) if to_disk else None,+ per_session, approximate+ )+ # The usage counts and access times only serve eviction+ track_usage = max_items is not None+ lru_dict = track_usage and policy == 'lru' and not to_disk+ # The bucket and the time of its last ttl sweep per method owner and+ # session, since the bucket hash is otherwise fixed for the function+ buckets: dict[tuple, tuple[str, list[float]]] = {} lock = threading.RLock() - def hash_func(*args, **kwargs):+ def lookup(args, kwargs): # Handle param.depends method by adding parameters to arguments- func_name = func.__name__- is_method = (
Exit cleanly when using launcherPython · 100 + / 51 −
Introduces 7 new declarations in src/accelerate/commands/launch.py.
Adds new core implementation rather than adjusting what was there. Tests changed with it, with code of their own.
src/accelerate/commands/launch.py ↗ · 3 files
@@ -981,19 +986,65 @@ def launch_command_parser(subparsers=None): return parser -def simple_launcher(args):- cmd, current_env = prepare_simple_launcher_cmd_env(args)+def _terminate_process_tree(process):+ processes = [process]+ # Capture descendants before stopping their parent, including workers in separate sessions.+ with suppress(psutil.NoSuchProcess):+ processes.extend(process.children(recursive=True))+ alive = processes+ try:+ for child in processes:+ with suppress(psutil.NoSuchProcess):+ child.terminate()+ _, alive = psutil.wait_procs(processes, timeout=5)+ except (KeyboardInterrupt, SystemExit):+ pass+ finally:+ for child in alive:+ with suppress(psutil.NoSuchProcess):+ child.kill()+ psutil.wait_procs(alive, timeout=5)+ process.wait()+ +def _run_subprocess(cmd, current_env, quiet): # Tee the child's stderr: write it through as it arrives so output stays live, and keep the tail for the error.- process = subprocess.Popen(cmd, env=current_env, stderr=subprocess.PIPE)+ process = psutil.Popen(cmd, env=current_env, stderr=subprocess.PIPE) tail = deque(maxlen=CHILD_STDERR_TAIL_CHUNKS)- while chunk := process.stderr.read1(CHILD_STDERR_CHUNK_SIZE):- sys.stderr.buffer.write(chunk)
hexagon: pass small aggregates on the stack when registers run outRust · 70 + / 19 −
Introduces 3 new declarations in compiler/rustc_target/src/callconv/hexagon.rs.
Adds new language design rather than adjusting what was there. Tests changed with it, with code of their own.
compiler/rustc_target/src/callconv/hexagon.rs ↗ · 3 files
@@ -41,29 +68,50 @@ where } if arg.layout.pass_indirectly_in_non_rustic_abis(cx) { arg.make_indirect();+ // The pointer to the indirectly passed value takes up a register.+ adjust_regs_left(Size::from_bytes(4), regs_left); return; } + let size = arg.layout.size;+ if !arg.layout.is_aggregate() {+ if size.bytes() <= 8 {+ adjust_regs_left(size, regs_left);+ } arg.extend_integer_width_to(32); return; } - // Per the Hexagon ABI:- // - Aggregates up to 32 bits are passed in a single register- // - Aggregates 33-64 bits are passed in a register pair- // - Aggregates > 64 bits are passed on the stack- let size = arg.layout.size;- let bits = size.bits();- if bits <= 32 {- arg.cast_to(Uniform::new(Reg::i32(), size));- } else if bits <= 64 {- arg.cast_to(Uniform::new(Reg::i64(), size));+ if size.bytes() > 8 {+ arg.pass_by_stack_offset(None);+ return;+ }+
fix: Keep pn.serve(threaded=True) working after the main thread finishesPython · 40 + / 0 −
Introduces 3 new declarations in panel/io/threads.py.
Adds new core implementation rather than adjusting what was there. Tests changed with it, with code of their own.
panel/io/threads.py ↗ · 2 files
@@ -12,6 +16,37 @@ _SHUTDOWN_TIMEOUT = 5 +_exit_hook_registered = False+_started_threads: weakref.WeakSet['StoppableThread'] = weakref.WeakSet()+++def _join_threads_at_exit() -> None:+ while threads := [thread for thread in list(_started_threads) if thread.is_alive()]:+ for thread in threads:+ thread.join()+++def _register_exit_hook() -> None:+ """+ Keep thread pools usable for as long as a StoppableThread is serving.++ When the main thread finishes, Python first disables all thread pools+ and only then waits for the remaining threads, so a server that keeps+ running in a thread could no longer hand off any work. Waiting for the+ server threads in a hook that runs before the pools are disabled avoids+ that. Such hooks run in reverse order of registration.+ """+ global _exit_hook_registered+ if _exit_hook_registered:+ return+ try:+ threading._register_atexit(_join_threads_at_exit) # type: ignore[attr-defined]+ except (AttributeError, RuntimeError):+ # No such hook, or the interpreter is already shutting down+ return+ _exit_hook_registered = True+
Resync watchers as they catch upGo · 89 + / 17 −
Introduces 5 new declarations in staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go.
Adds new systems design rather than adjusting what was there. Tests changed with it, with code of their own.
staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go ↗ · 3 files
@@ -620,21 +654,32 @@ func (c *Cacher) resyncWatchers() { c.stopWatcherLocked(watcher, true) continue }- if stalledWatchers.empty() {- stalledWatchers = indexedWatchers{- scopeWatchers: make(map[namespacedName]watchersMap),- indexWatchers: make(map[string]watchersMap),- }- minResourceVersion = watcher.dispatchedResourceVersion- } else if watcher.dispatchedResourceVersion < minResourceVersion {- minResourceVersion = watcher.dispatchedResourceVersion- }- stalledWatchers.addWatcher(watcher)+ stalled = append(stalled, watcher) }+ return stalled+} - if !stalledWatchers.empty() {- c.resyncStalledWatchersLocked(&stalledWatchers, minResourceVersion)+func rsyncMinResourceVersion(candidates []*cacheWatcher, cursorRV uint64) uint64 {+ if minRV, ok := minDispatchedResourceVersion(candidates, cursorRV); ok {+ return minRV+ }+ minRV, _ := minDispatchedResourceVersion(candidates, 0)+ return minRV+}++func minDispatchedResourceVersion(watchers []*cacheWatcher, floorRV uint64) (uint64, bool) {+ var minRV uint64+ found := false+ for _, watcher := range watchers {+ if watcher.dispatchedResourceVersion < floorRV {
Extract eventsAfterLocked and checkResourceVersionLocked methodsGo · 40 + / 13 −
Introduces 3 new declarations in staging/src/k8s.io/apiserver/pkg/storage/cacher/watch_cache_history.go.
Adds new systems design rather than adjusting what was there. Tests changed with it, with code of their own.
staging/src/k8s.io/apiserver/pkg/storage/cacher/watch_cache_history.go ↗ · 2 files
@@ -219,26 +220,52 @@ func (w *watchCacheHistory) suggestedWatchChannelSize(indexExists, triggerUsed b // retrieve events since a certain resourceVersion. This function assumes to // be called under the lock. func (w *watchCacheHistory) GetIntervalLocked(resourceVersion uint64, locker sync.Locker) (*watchCacheInterval, error) {- size := w.endIndex - w.startIndex+ if err := w.checkResourceVersionLocked(resourceVersion); err != nil {+ return nil, err+ }+ first := w.firstIndexAfterLocked(resourceVersion)+ indexerFunc := func(i int) *watchCacheEvent {+ return w.cache[i%w.capacity]+ }+ ci := newCacheInterval(first, w.endIndex, indexerFunc, w.config.indexValidator, resourceVersion, locker)+ return ci, nil+}++// eventsAfterLocked yields buffered events with ResourceVersion > resourceVersion+// in ascending ResourceVersion order. This function assumes to be called under+// the lock.+func (w *watchCacheHistory) eventsAfterLocked(resourceVersion uint64) iter.Seq[*watchCacheEvent] {+ return func(yield func(*watchCacheEvent) bool) {+ for i := w.firstIndexAfterLocked(resourceVersion); i < w.endIndex; i++ {+ if !yield(w.cache[i%w.capacity]) {+ return+ }+ }+ }+}++// checkResourceVersionLocked verifies that history is initialized and can+// still serve events strictly after resourceVersion. This function assumes to+// be called under the lock.+func (w *watchCacheHistory) checkResourceVersionLocked(resourceVersion uint64) error { oldest, ok := w.oldestServableLocked()
Do not suggest `as_deref` for a slice pattern on `Err`Rust · 84 + / 5 −
Introduces 6 new declarations in compiler/rustc_hir_typeck/src/pat.rs.
Adds new language design rather than adjusting what was there. Tests changed with it, with code of their own.
compiler/rustc_hir_typeck/src/pat.rs ↗ · 3 files
@@ -3309,6 +3317,77 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> { }) } + fn slice_pattern_is_direct_payload(+ &self,+ top_pat_id: HirId,+ slice_id: HirId,+ is_option: bool,+ ) -> bool {+ let Some(ctor_id) = self.next_significant_pat(slice_id, top_pat_id) else {+ return false;+ };+ self.hir_pat_is_some_or_ok(ctor_id, is_option)+ && self.only_transparent_pats_until(ctor_id, top_pat_id)+ }++ /// First ancestor pattern that is not `&`, a guard, a binding, or an or-pattern.+ /// `None` when that walk reaches `top_pat_id` or leaves the pattern without one.+ fn next_significant_pat(&self, start: HirId, top_pat_id: HirId) -> Option<HirId> {+ for (id, node) in self.tcx.hir_parent_iter(start) {+ let hir::Node::Pat(pat) = node else { return None };+ if self.pat_is_transparent(pat) {+ if id == top_pat_id {+ return None;+ }+ continue;+ }+ return Some(id);+ }+ None+ }++ /// `start` is `top_pat_id`, or every pattern from `start` up through `top_pat_id`