Selected changesmerged Oct 14, 2026
Structure watch processing into clean 2 stagesGo · 56 + / 60 −
Introduces 3 new declarations in staging/src/k8s.io/apiserver/pkg/storage/cacher/cache_watcher.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/cache_watcher.go ↗ · 3 files
@@ -447,42 +447,29 @@ func (c *cacheWatcher) sendWatchCacheEvent(event *watchCacheEvent) (builtAt, sen return builtAt, sentAt } -// streamInterval sends every event of cacheInterval to the result channel,-// advancing *resourceVersion to the highest resourceVersion of any event the-// interval yielded (including events the watcher's filter drops). It returns-// the number of events the interval yielded. A non-nil error means the-// interval has been invalidated (the watch cache history moved past it) and-// can no longer serve events; the returned count is then meaningless.-func (c *cacheWatcher) streamInterval(cacheInterval *watchCacheInterval, resourceVersion *uint64) (int, error) {- eventCount := 0- for event, err := range cacheInterval.All() {- if err != nil {- return eventCount, err- }- c.sendWatchCacheEvent(event)-- // With some events already sent, update resourceVersion so that- // events that were buffered and not yet processed won't be delivered- // to this watcher second time causing going back in time.- //- // There is one case where events are not necessary ordered by- // resourceVersion, being a case of watching from resourceVersion=0,- // which at the beginning returns the state of each objects.- // For the purpose of it, we need to max it with the resource version- // that we have so far.- if event.ResourceVersion > *resourceVersion {- *resourceVersion = event.ResourceVersion- }- eventCount++- }- return eventCount, nil-}
Fix fudgingRust · 65 + / 57 −
Introduces 4 new declarations in compiler/rustc_hir_typeck/src/fn_ctxt/checks.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/fn_ctxt/checks.rs ↗ · 9 files
@@ -3612,50 +3602,63 @@ enum SuggestionText { DidYouMean, } -fn same_type_modulo_vars<'tcx>(tcx: TyCtxt<'tcx>, a: Ty<'tcx>, b: Ty<'tcx>) -> bool {- struct SameModuloVars<'tcx> {- tcx: TyCtxt<'tcx>,+/// Postprocessing step of fudging: after fudging, any changes from the formal input type to the+/// expected input type are only kept, if they result in structural changes. If the only change is+/// one inference variable changing to another (fresh) inference variable, the formal one is kept,+/// not the fresh one. This avoids cases in which those fresh inference variables are *less*+/// constrained than the original formal ones, and making them fresh has no benefit.+fn only_keep_structural_changes<'tcx>(+ infcx: &InferCtxt<'tcx>,+ formal: Ty<'tcx>,+ expected: Ty<'tcx>,+) -> Ty<'tcx> {+ struct OnlyKeepStructuralChanges<'a, 'tcx> {+ infcx: &'a InferCtxt<'tcx>, }- impl<'tcx> TypeRelation<TyCtxt<'tcx>> for SameModuloVars<'tcx> {+ impl<'tcx> TypeRelation<TyCtxt<'tcx>> for OnlyKeepStructuralChanges<'_, 'tcx> { fn cx(&self) -> TyCtxt<'tcx> {- self.tcx+ self.infcx.tcx } fn relate_ty_args( &mut self,- a_ty: Ty<'tcx>,- _b_ty: Ty<'tcx>,- _ty_def_id: DefId,- a_args: ty::GenericArgsRef<'tcx>,- b_args: ty::GenericArgsRef<'tcx>,
Add `MtpModel` helpers for frameworks that own the drafting loopPython · 76 + / 37 −
Introduces 4 new declarations in src/transformers/modeling_layers.py.
Adds new framework internals rather than adjusting what was there. Read the linked PR for the surrounding test context.
src/transformers/modeling_layers.py ↗ · 1 files
@@ -563,13 +547,53 @@ def forward( candidate_logits = torch.cat(drafted_logits, dim=1) return new_candidate_ids, candidate_logits, loss - @classmethod- def from_pretrained(cls, main_model: PreTrainedModel, device_map=None, **kwargs) -> MtpModel:- pretrained_model_name_or_path = main_model.config.name_or_path+ def forward_layer(+ self,+ layer_idx: int,+ last_hidden_states: torch.Tensor,+ position_ids: torch.Tensor | None,+ mtp_cache: MtpCache | None,+ input_ids: torch.Tensor | None = None,+ inputs_embeds: torch.Tensor | None = None,+ **kwargs,+ ) -> torch.Tensor:+ """+ Run the mtp layer `layer_idx` once, i.e. a single step of the drafting loop in `forward`. Exactly one of `input_ids`+ or `inputs_embeds` should be passed. This lets frameworks which own the drafting loop (e.g. vLLM) reuse the per-layer+ logic.+ """+ if (input_ids is None) == (inputs_embeds is None):+ raise ValueError("You must specify exactly one of input_ids or inputs_embeds")+ # We need to recompute those every layer since they change+ if inputs_embeds is None:+ inputs_embeds = self.embed_tokens(input_ids).to(last_hidden_states.device)++ # In full generality, we may need to recompute masks for every layer due to the position offset of each layer+ masks = self.create_masks_for_mtp_layer(layer_idx, inputs_embeds, mtp_cache, position_ids)++ position_embeddings = (+ self.rotary_emb(inputs_embeds, position_ids=position_ids) if self.rotary_emb is not None else None+ )
[Flight] Improve transport protocolJavaScript · 498 + / 183 −
Introduces 8 new declarations in packages/react-server/src/ReactFlightReplyBackingFormData.js.
Adds new language design rather than adjusting what was there. Tests changed with it, with code of their own.
packages/react-server/src/ReactFlightReplyBackingFormData.js ↗ · 17 files
@@ -8,100 +8,160 @@ */ /**- * Backing FormData is a wrapper around FormData that allows iterating over the- * keys while allowing to evict values from the FormData without affecting the iteration.- * Native FormData.keys() will skip keys if entries with Blob are deleted e.g.- * ```js- * const formData = new FormData();- * formData.append('a', new Blob());- * formData.append('b', 2);- * const keys = formData.keys();- * keys.next().value; // 'a'- * formData.delete('a');- * keys.next().value; // undefined, but we expect 'b'- * ```+ * Backing FormData indexes the entries of a reply payload so that no lookup+ * ever scans a live FormData instance. FormData.get/getAll/delete are linear+ * in the number of entries in every major runtime, which could make decoding+ * quadratic in the payload size. Every structure here is either an append-only+ * array with a cursor or a map, so no operation is proportional to the total+ * number of stored entries.+ *+ * Keys are classified by the character following the response prefix:+ * - '_' starts the namespace of referenced FormData entries. These are only+ * ever consumed in insertion order by the "$K" scan, so they go into a+ * plain array with a cursor.+ * - 'S' starts the namespace of stream/async-iterable chunks. These are the+ * only fields that can repeat, so they accumulate in an array per key.+ * - Everything else is a one-shot chunk or an outlined Blob, looked up by+ * exact field name. */ export opaque type BackingFormData = {- data: FormData,
fix: use the finite-sample conformal quantile for conformal intervalsPython · 52 + / 22 −
Introduces 2 new declarations in python/statsforecast/models.py.
Adds new core implementation rather than adjusting what was there. Tests changed with it, with code of their own.
python/statsforecast/models.py ↗ · 5 files
@@ -4398,22 +4401,13 @@ def __init__( alias = "CSP-Adaptive" if variant == "adaptive" else "CSP-Fixed" self.alias = alias - @staticmethod- def _oriented_index(q: float, n: int) -> float:- if n <= 0:- return float(q)- if q < 0.5:- return max(0.0, float(np.floor((n + 1.0) * q)) / n)- return min(1.0, float(np.ceil((n + 1.0) * q)) / n)- def _intervals_from_samples( self, samples: np.ndarray, level: Sequence[Union[int, float]] ) -> Dict[str, np.ndarray]: cuts = [(1 - lv / 100) / 2 for lv in reversed(level)] cuts += [1 - (1 - lv / 100) / 2 for lv in level]- n = samples.shape[0]- oriented = [self._oriented_index(c, n) for c in cuts]- quantiles = np.quantile(samples, oriented, axis=0)+ upper = [False] * len(level) + [True] * len(level)+ quantiles = _conformal_quantile(samples, cuts, upper, axis=0) lo_cols = [f"lo-{lv}" for lv in reversed(level)] hi_cols = [f"hi-{lv}" for lv in level] return {col: quantiles[i] for i, col in enumerate(lo_cols + hi_cols)}