Selected changesmerged Nov 14, 2026
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+
Add verbosity helper function Python · 44 + / 1 −
Introduces 6 new declarations in src/accelerate/logging.py.
Adds new core implementation rather than adjusting what was there. Tests changed with it, with code of their own.
src/accelerate/logging.py ↗ · 3 files
@@ -20,6 +20,48 @@ from .state import PartialState +def get_verbosity() -> int:+ """Return the effective logging level of the Accelerate library logger as an integer."""+ return logging.getLogger("accelerate").getEffectiveLevel()+++def set_verbosity(verbosity: int | str) -> None:+ """+ Set the logging level of the Accelerate library logger.++ This affects existing and future loggers in the `accelerate` namespace that inherit their level. Loggers with a+ level set explicitly, including through `get_logger`'s `log_level` argument or `ACCELERATE_LOG_LEVEL`, retain that+ level. The Python root logger and loggers outside the `accelerate` namespace are not modified.++ Args:+ verbosity (`int` or `str`):+ A Python logging level, such as `logging.WARNING`, or a case-insensitive level name, such as `"warning"`.+ """+ if isinstance(verbosity, str):+ verbosity = verbosity.upper()+ logging.getLogger("accelerate").setLevel(verbosity)+++def set_verbosity_debug() -> None:+ """Set the Accelerate library's verbosity to `DEBUG`."""+ set_verbosity(logging.DEBUG)+++def set_verbosity_info() -> None:+ """Set the Accelerate library's verbosity to `INFO`."""+ set_verbosity(logging.INFO)
mtmd : allow custom video decoderC++ · 628 + / 506 −
Introduces 10 new declarations in tools/mtmd/mtmd-helper.cpp.
Adds new runtime rather than adjusting what was there. Tests changed with it, with code of their own.
tools/mtmd/mtmd-helper.cpp ↗ · 8 files
@@ -790,523 +806,181 @@ int32_t mtmd_helper_video_seq::read_next(mtmd_bitmap ** out_bitmap, char ** out_ return 0; } -#ifdef MTMD_VIDEO- struct mtmd_helper_video : mtmd_helper_video_seq {- const mtmd_context * mctx;- std::string path;- std::vector<uint8_t> input_buf; // non-empty when initialized from buffer- std::string ffmpeg_bin;- std::string ffprobe_bin;-- // RAII wrapper for managing subprocess- struct subprocess_handle {- struct subprocess_s proc = {};- bool created = false; // process exists and must be cleaned up- bool alive = false; // process can still give us data- std::thread feeder;-- subprocess_handle() = default;- subprocess_handle(const subprocess_handle &) = delete;- subprocess_handle & operator=(const subprocess_handle &) = delete;- ~subprocess_handle() { stop(); }-- void stop() {- // note: alive becomes false on stdout EOF, but the process still needs cleanup- if (!created) {- return;- }- subprocess_terminate(&proc);-#ifdef _WIN32- // no SIGPIPE on windows: a blocked feeder only gets a broken pipe once we close our read end of the child stdin- if (proc.hStdInput) {
KEP-5491: Avoid repeated list-to-set conversion in list-aware matchAttribute/distinctAttribute constraint evaluationGo · 496 + / 134 −
Introduces 11 new declarations in staging/src/k8s.io/dynamic-resource-allocation/structured/internal/allocatortesting/allocator_testing.go.
Adds new systems design rather than adjusting what was there. Tests changed with it, with code of their own.
staging/src/k8s.io/dynamic-resource-allocation/structured/internal/allocatortesting/allocator_testing.go ↗ · 8 files
@@ -9390,6 +9390,226 @@ func TestAllocator(t *testing.T, expectWithFeatures: expectDistinctAttributeWithLists, }, + // A derived attribute can evaluate to a list, so both constraints must+ // compare the results of request-scoped CEL expressions as sets.+ "list-attributes-match-constraint-on-derived-list-values-with-common-elements": {+ features: Features{+ ListTypeAttributes: true,+ DerivedAttributes: true,+ },+ claimsToAllocate: objects(claimWithRequests(+ claim0,+ []resourceapi.DeviceConstraint{+ {+ Requests: []string{req0, req1},+ MatchAttribute: ptr.To(resourceapi.FullyQualifiedName("derived/tags")),+ },+ },+ requestWithDerivedAttributes(req0, classA, 1,+ []resourceapi.DeviceDerivedAttribute{{+ Name: "derived/tags",+ Expression: fmt.Sprintf(`device.attributes["%s"]["tags"]`, driverA),+ }},+ ),+ requestWithDerivedAttributes(req1, classB, 1,+ []resourceapi.DeviceDerivedAttribute{{+ Name: "derived/tags",+ Expression: fmt.Sprintf(`device.attributes["%s"]["labels"]`, driverB),+ }},+ ),+ )),+ classes: objects(class(classA, driverA), class(classB, driverB)),+ slices: unwrapResourceSlices(
turbo-persistence: don't modify the directory on read-only openRust · 158 + / 4 −
Introduces 8 new declarations in turbopack/crates/turbo-persistence/src/tests.rs.
Adds new framework internals rather than adjusting what was there. Read the linked PR for the surrounding test context.
turbopack/crates/turbo-persistence/src/tests.rs ↗ · 2 files
@@ -3612,3 +3617,150 @@ fn batch_get_callback_error_propagates(#[case] mmap: bool) -> Result<()> { db.shutdown(); Ok(()) }++/// Snapshot of every entry in a persistence directory: file name to file content. Used to check+/// that read-only opens leave the directory exactly as they found it.+fn dir_snapshot(path: &Path) -> Result<BTreeMap<String, Vec<u8>>> {+ let mut snapshot = BTreeMap::new();+ for entry in fs::read_dir(path)? {+ let entry = entry?;+ let name = entry.file_name().into_string().expect("utf-8 file name");+ snapshot.insert(name, fs::read(entry.path())?);+ }+ Ok(snapshot)+}++/// Names of the `.sst` / `.meta` / `.blob` files currently in `path`, keyed by sequence number.+fn data_file_seqs(path: &Path) -> Result<BTreeSet<u32>> {+ let mut seqs = BTreeSet::new();+ for entry in fs::read_dir(path)? {+ let path = entry?.path();+ if matches!(+ path.extension().and_then(|ext| ext.to_str()),+ Some("sst" | "meta" | "blob")+ ) {+ seqs.insert(path.file_stem().unwrap().to_str().unwrap().parse()?);+ }+ }+ Ok(seqs)+}++/// A database on the serial scheduler, for the read-only open tests.+type SerialDb = TurboPersistence<crate::parallel_scheduler::SerialScheduler, 1>;