Selected changesmerged Nov 16, 2026
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)
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)
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 {
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`
BUG: Avoid excessive temporary memory in StringDType slice and replaceC++ · 284 + / 145 −
Introduces 5 new declarations in numpy/_core/src/umath/stringdtype_ufuncs.cpp.
Adds new language design rather than adjusting what was there. Tests changed with it, with code of their own.
numpy/_core/src/umath/stringdtype_ufuncs.cpp ↗ · 5 files
@@ -2257,6 +2272,104 @@ slice_resolve_descriptors(PyArrayMethodObject *self, return NPY_NO_CASTING; } +template <ENCODING enc>+static int+write_slice_impl(Buffer<enc> in, npy_intp lowest_idx, npy_intp slice_length, npy_intp step,+ npy_packed_static_string *ops, npy_string_allocator *oallocator)+{+ npy_static_string os = {0, NULL};+ // an empty backwards slice can have lowest_idx == -1+ if (slice_length > 0) {+ in += lowest_idx;+ }+ char *first = in.buf;++ if (step == 1) {+ in += slice_length;+ npy_intp outsize = in.buf - first;+ if (load_new_string(ops, &os, outsize, oallocator, "slice") < 0) {+ return -1;+ }+ /* explicitly discard const; initializing new buffer */+ memcpy((char *)os.buf, first, outsize);+ return 0;+ }++ bool reverse = step < 0;+ npy_intp codepoint_stride = reverse ? -step : step;+ npy_intp outsize = slice_length;+ if (enc == ENCODING::UTF8) {+ // UTF-8 codepoints have variable byte widths. Measure the selected+ // characters before allocating exactly the final size.+ outsize = 0;