Selected changesmerged Nov 26, 2026
ENH: Unify mixed operand handling and preserve trailing NULs in string operationsPython · 165 + / 110 −
Introduces 8 new declarations in numpy/_core/strings.py.
Adds new core implementation rather than adjusting what was there. Tests changed with it, with code of their own.
numpy/_core/strings.py ↗ · 5 files
@@ -684,6 +713,48 @@ def expandtabs(a, tabsize=8): return _expandtabs(a, tabsize, out=out) +def _use_variable_stringdtype(*arrays):+ return np.result_type(*arrays).char == "T"+++def _cast_string_arg(arg, dtype):+ # This is questionable: None is used as "None" and 1 as "1", where the+ # str methods raise TypeError.+ return arg.astype(dtype, copy=False)+++def _get_fillchar(a, fillchar):+ if type(fillchar) is str and a.dtype.char == "T":+ # A fixed-width array would drop a trailing NUL.+ fillchar = np.array(fillchar, dtype=a.dtype)+ else:+ fillchar = np.asanyarray(fillchar)+ if np.any(str_len(fillchar) != 1):+ raise TypeError(+ "The fill character must be exactly one character long")+ return fillchar+++def _just(ufunc, a, width, fillchar):+ width = np.asanyarray(width)+ if not np.issubdtype(width.dtype, np.integer):+ raise TypeError(f"unsupported type {width.dtype} for operand 'width'")++ a = np.asanyarray(a)+ fillchar = _get_fillchar(a, fillchar)+
Stop silently retrying bundler downloads without certificate verificationPython · 34 + / 9 −
Introduces 2 new declarations in panel/compiler.py.
Adds new core implementation rather than adjusting what was there. Tests changed with it, with code of their own.
panel/compiler.py ↗ · 3 files
@@ -78,15 +79,39 @@ def _session(): return session +def _insecure_downloads():+ return os.environ.get('PANEL_BUNDLE_INSECURE', '').strip().lower() in ('1', 'true', 'yes')++ def _download(url):+ """+ Fetches a url, returning a (response, error) pair.++ Certificate verification is only disabled when PANEL_BUNDLE_INSECURE is+ set, for builds behind a TLS-inspecting proxy that cannot be given a CA+ bundle via REQUESTS_CA_BUNDLE or SSL_CERT_FILE.+ """+ kwargs = {}+ if _insecure_downloads():+ kwargs['verify'] = False+ warnings.warn(+ 'PANEL_BUNDLE_INSECURE is set, TLS certificate verification is '+ f'disabled for the download of {url}.', stacklevel=2+ ) try:- response, error = _session().get(url, timeout=10), None- except Exception:- try:- response, error = _session().get(url, verify=False, timeout=10), None- except Exception as e:- response, error = None, e- return response, error+ return _session().get(url, timeout=10, **kwargs), None+ except Exception as e:+ return None, e
Share retain implementation between Vec and VecDequeRust · 345 + / 118 −
Introduces 8 new declarations in library/alloc/src/collections/retain.rs.
Adds new language design rather than adjusting what was there. Tests changed with it, with code of their own.
library/alloc/src/collections/retain.rs ↗ · 8 files
@@ -0,0 +1,248 @@+use core::{cmp, hint, mem, ptr};++/// Returns a pointer to the slot at the given logical index.+///+/// # Safety+///+/// There are `front_len` slots in `front` and if `index >= front_len`,+/// there are `index - front_len + 1` slots in `back` at least.+#[inline]+unsafe fn slot<T>(front: *mut T, front_len: usize, back: *mut T, index: usize) -> *mut T {+ // SAFETY: Upheld by caller.+ unsafe { if index < front_len { front.add(index) } else { back.add(index - front_len) } }+}++/// Retains elements in two contiguous regions according to `f`.+///+/// The `*total_len` initialized elements are treated as one logical sequence:+/// the first `front_len` elements start at `front`, and the remaining elements+/// start at `back`.+///+/// Each element is passed to `f` in logical order. Elements for which `f`+/// returns `true` are compacted toward the beginning of the logical sequence,+/// preserving their relative order. Rejected elements are dropped.+///+/// On return, `*total_len` is updated to the number of retained elements.+///+/// On panic, retained and unchecked elements, including the element whose+/// predicate panicked, are compacted and `*total_len` is updated accordingly.+///+/// Uses the specialized `SINGLE_REGION` in `PanicGuard` to+/// eliminate unnecessary stack usage and move unchecked elements+/// with a single bulk copy for `Vec`.+///
Add the next/go SDK and move Go Proxy helpers into itTypeScript · 828 + / 132 −
Introduces 24 new declarations in packages/next/src/lib/go-sdk.ts.
Adds new framework internals rather than adjusting what was there. Tests changed with it, with code of their own.
packages/next/src/lib/go-sdk.ts ↗ · 38 files
@@ -0,0 +1,471 @@+import { execFile } from 'child_process'+import { existsSync, promises as fs, realpathSync } from 'fs'+import path from 'path'+import { promisify } from 'util'+import * as Log from '../build/output/log'++const execFileAsync = promisify(execFile)++// The Go SDK ships in the installed `next` package. A directory replacement maps+// its module path there, so builds, editors and linters resolve the SDK version+// that matches the running Next.js without downloading anything.+const GO_SDK_MODULE = 'next/go'+// Go accepts any version for a module replaced by a directory. Use the same one+// everywhere, so apps and libraries that import the SDK agree.+const GO_SDK_VERSION = 'v0.0.0'++type GoMod = {+ Require?: Array<{ Path: string; Version: string }> | null+ Replace?: Array<{+ Old: { Path: string; Version?: string }+ New: { Path: string; Version?: string }+ }> | null+}++export type GoSdkOptions = {+ /** The Next.js project directory. */+ dir: string+ /**+ * Turbopack's root (`turbopack.root`, `outputFileTracingRoot`, or `dir`). In a+ * monorepo this is the workspace root: the Go module can live there or in the+ * project, and the SDK can be installed anywhere below it.+ */+ rootDir: string
[`distributed`] Add a new parallel plan for unit shardingPython · 245 + / 90 −
Introduces 41 new declarations in src/transformers/distributed/tensor_parallel.py.
Adds new core implementation rather than adjusting what was there. Tests changed with it, with code of their own.
src/transformers/distributed/tensor_parallel.py ↗ · 8 files
@@ -213,6 +213,71 @@ def transform_output_post_forward(self, module, output, mesh): return output.to_local() if self.use_local_output else output +class UnitColwiseParallel(ColwiseParallel):+ """This forces all ranks to own at least 1 unit of the tensor.+ It is designed to be used on `query/key/value` layers when running TP.+ For `query = nn.Linear(hidden_dim, head_dim * num_heads)` you can't divide the second dimension blindly by the world size as the attention REQUIRES to split per-head. You cannot split 2 heads of dim 64 into 4 GPUs by just separating into 4 x 32. This would mix the heads.++ The unit colwise handles 2 cases:+ - Less heads than world size: 2 heads, 4 process -> we replicate the heads.+ Rank: | 0 | 1 | 2 | 3 |+ This gives: |h0 | h0 | h1 | h1|++ - More heads than world size: 6 heads, 4 process -> we also replicate the heads.+ Rank: | 0 | 1 | 2 | 3 |+ This gives: |h0h1h2|h0h1h2|h3h4h5|h3h4h5|++ We need to have [Shard(0), Replicate()] .++ TODO: this only handles head-aligned Linear weights. Extra per-head parameters attached directly to+ the attention module, such as Beam's `gate_bias` or GraniteSWA's `sinks`, are not supported yet.+ A clean fix needs a dedicated style instead of treating every sharded parameter as a Linear weight.+ """++ def shard_param(self, module, param, mesh, *, config=None, mesh_manager=None):+ meta = module._parameters.get(param)+ if meta is None:+ return+ weight = module._parameters["weight"]+ head_dim = getattr(config, "head_dim", None) or config.hidden_size // config.num_attention_heads+ module._unit_mesh = mesh_manager.get_unit_mesh(weight.shape[0] // head_dim)+ module._parameters[param] = torch.nn.Parameter(+ distribute_tensor(meta, module._unit_mesh, [Shard(meta.ndim - 2), Replicate()], src_data_rank=None),