sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: react
Issue: [React 19] Dynamically importing a data fetching hook via `use()` leads to an error
Labels: Resolution: Needs More Information,React 19

### Describe the bug

I've been trying to create a component which would encapsulate data loading logic, to have the most granular approach to using `<Suspense/>`, avoiding UI duplication with skeletons. My goal was to have _one component_ which would handle suspending, fallback UI, loading, polling, errors, etc, and be used in a _server component_ like so:

```
 <AsyncValue
    query={useSomeQuery} // query wrapper fn or potentially a query wrapper fn name string 
    queryProps={{
        itemId: "0001", // optional query props 
    }}
    dataKey="name" // optional accessor to a value which `extends ReactNode` in case an object is returned 
    render={Value} // Some valid React compoennt 
/>
```

This, **afaik**, would result in everything but the suspended value being pre-rendered server-side, eliminating the need to care about large skeletons, duplicating layout components or what not. Thought that would be neat?

I have arrived at a working solution, but a hacky one, as it used `throw` to trigger `<Suspense />`. When it struck me that we now have the `use()` hook to handle exactly what I thought was needed – keeping a component suspended while dynamically importing a hook. However, when I tried using it I saw: 

`Error: Update hook called on initial render. This is likely a bug in React. Please file an issue.`

Even though it seems to function. The data fetch is fired on the server, response is streamed to the client, where the hook proceeds to poll and update the value.

TLDR:

- Is dynamically importing hooks even viable or it ruins some logic under the hood?
- If is is viable, can it be done via a `use()` hook to trigger `<Suspense />` boundaries?

### Reproducible example

https://codesandbox.io/p/devbox/6xmt4y

### Expected behavior

Work with `use()` like it does without it.

### React version

19.0.0-rc-2d16326d-20240930

### Related issue

https://github.com/TanStack/query/issues/8362
Repository: rust
Issue: Tracking issue for release notes of #116161: Stabilize `extended_varargs_abi_support`
Labels: T-lang,T-compiler,relnotes,F-extended_varargs_abi_support,relnotes-tracking-issue


This issue tracks the release notes text for #116161.

### Steps

- [x] Proposed text is drafted by PR author (or team) making the noteworthy change.
- [ ] Issue is nominated for release team review of clarity for wider audience.
- [x] Release team includes text in release notes/blog posts.

### Release notes text

The responsible team for the underlying change should edit this section to replace the automatically generated link with a succinct description of what changed, drawing upon text proposed by the author (either in discussion or through direct editing).

````markdown
# Language
- [Support var-args for more calling conventions](https://github.com/rust-lang/rust/pull/116161) 
  This stabilizes usage of `...` variable args in extern declarations for `cdecl`, `system`, `aapcs`, `sysv64`, `win64`, and `efiapi` calling conventions.
````

> [!TIP]
> Use the [previous releases](https://doc.rust-lang.org/nightly/releases.html) categories to help choose which one(s) to use.
> The category will be de-duplicated with all the other ones by the release team.
>
> *More than one section can be included if needed.*

### Release blog section

If the change is notable enough for inclusion in the blog post, the responsible team should add content to this section.
*Otherwise leave it empty.*

````markdown
````

cc @Soveu, @cjgillot -- origin issue/PR authors and assignees for starting to draft text
Repository: rust
Issue: Many applications on Windows (e.g. the Chocolatey wrapper) do not work when current_dir is a canonicalized path
Labels: O-windows,C-bug,T-libs

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.
-->

I found a "weird" issue with std::process::Command and canonicalized paths on Windows. Something like (which assumes [lsd](https://github.com/lsd-rs/lsd) is installed on the machine):

```rust
let p1 = Path::new(".");
let p2 = p1.canonicalize().unwrap();

let e = std::process::Command::new("lsd").current_dir(&p1).spawn().wait_for_output().unwrap();
println!("P1 = {e:?}");

let e = std::process::Command::new("lsd").current_dir(&p2).spawn().wait_for_output().unwrap();
println!("P2 = {e:?}");
```

... works fine for the first execution, showing the current directory contents; but the second execution fails with

```
Unhandled Exception: System.ArgumentException: Illegal characters in path.
   at System.Security.Permissions.FileIOPermission.EmulateFileIOPermissionChecks(String fullPath)
   at System.IO.Directory.InternalGetCurrentDirectory(Boolean checkHost)
   at shim.ShimProgram.Main(String[] args)
```

... which looks like it is caused due `.canonicalize()` prefixing the path with "\\\\?\\" -- which, for what I can understand, correct, telling Windows that the path must be taken as-in, without any processing.

### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

`rustc --version --verbose`:
```
rustc 1.82.0 (f6e511eec 2024-10-15)
binary: rustc
commit-hash: f6e511eec7342f59a25f7c0534f1dbea00d01b14
commit-date: 2024-10-15
host: x86_64-unknown-linux-gnu
release: 1.82.0
LLVM version: 19.1.1
```

Also note that I'm cross-compiling from Linux to Windows, using "x86_64-pc-windows-gnu" as target triple.
Repository: vscode
Issue: Editor GPU: Canvas stretches on resize
Labels: bug,editor-gpu

Repro:

1. Open editor with GPU acceleration
2. Resize canvas, 🐛 notice that the canvas stretches until the debounced resize kicks in
Repository: PowerToys
Issue: Convert Mis-Typed Text Between Languages
Labels: Needs-Triage

### Description of the new feature / enhancement

Often, I accidentally type text in Persian when I think my keyboard is set to English. For example, I intended to type:
**"Does Raspberry Pi 5 support ADC?".**
But because my keyboard was on Persian, it came out as:
**"يخثس ًشسحذثققه [ه ۵ سعححخقف ؤيژ؟".**

It would be incredibly helpful to have a tool that could automatically convert such mis-typed text back to the intended language. For example, by selecting incorrect text and pressing a combined key, the sentence could be converted to English or Persian. This feature would save a lot of time and reduce errors for users who frequently switch between different language keyboards.

### Scenario when this would be used?

This feature would be especially useful for users who frequently switch between different language keyboards. For instance, developers, multilingual individuals, or professionals working in diverse linguistic environments might often find themselves accidentally typing in the wrong language. A tool that can automatically convert mis-typed text back to the intended language would streamline their workflow, prevent errors, and save significant amounts of time. This would enhance productivity and reduce frustration for users who deal with multiple languages on a daily basis.

### Supporting information

_No response_
Repository: deno
Issue: Streams: commit pull-into descriptors after filling from queue
Labels: web

In https://github.com/whatwg/streams/security/advisories/GHSA-p5g2-876g-95h9, we discovered that in Chromium, a user could run JavaScript code *synchronously* during `ReadableStreamFulfillReadIntoRequest` by patching `Object.prototype.then`, and use this gadget to break some invariants within `ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue`. Fortunately, [Deno was unaffected](https://github.com/whatwg/streams/security/advisories/GHSA-p5g2-876g-95h9#advisory-comment-102576).

The Streams standard has been updated with a proper fix for this case. We now postpone all calls to `ReadableByteStreamControllerCommitPullIntoDescriptor` until *after* all pull-into descriptors have been filled up by `ReadableByteStreamControllerProcessPullIntoDescriptorsUsingQueue`. This way, we won't trigger any patched `then()` method until the stream is in a stable state.

* Specification change: https://github.com/whatwg/streams/pull/1326
* WPT tests: https://github.com/web-platform-tests/wpt/pull/48085
Repository: excalidraw
Issue: Text fit to screen width
Labels: enhancement

Hi, I would like to propose that text be able to adapt to the width of the screen. Currently, when writing a long text, only the last few words are displayed, while the initial text is out of view. This creates an extended text box that, in most cases, needs to be adjusted manually. This would be especially useful on vertical monitors or mobile phones.

![Image](https://github.com/user-attachments/assets/1d4bfcd6-b4df-48d3-92c5-6cba262ad340)
Repository: pytorch
Issue: inductor and eager gives slightly different results for rms_norm, with `emulate_precision_casts=True`
Labels: triaged,oncall: pt2

repro below:
```python
import torch
torch._inductor.config.emulate_precision_casts = True

def f(x, scale):
    y = x.float()
    z = torch.rms_norm(y, (4096,), scale, 1e-05)
    return z.to(dtype=torch.bfloat16)

torch.manual_seed(0)
x = torch.randn(2, 157, 4096, device='cuda:0', dtype=torch.bfloat16)
scale = torch.randn(4096, device='cuda:0', dtype=torch.bfloat16)

f_compiled = torch.compile(f)
out_eager = f(x, scale)
out = f_compiled(x, scale)
out_fp64 = torch.rms_norm(x.to(dtype=torch.float64), (4096,), scale.to(dtype=torch.float64), 1e-05)

print(torch.max(torch.abs(out_fp64 - out_eager)))
print(torch.max(torch.abs(out_fp64 - out)))
print(torch.max(torch.abs(out_eager - out)))
print(torch.allclose(out_eager, out))
```

I'm not sure if this is expected, but even with `emulate_precision_casts=True` this prints the below for me:
```
tensor(0.0311, device='cuda:0', dtype=torch.float64)
tensor(0.0311, device='cuda:0', dtype=torch.float64)
tensor(0.0078, device='cuda:0', dtype=torch.bfloat16)
```

so compile and eager are equally close to an fp64 comparison, but they are not the same.

cc @chauhang @penguinwu
Repository: godot
Issue: Bottom panel: Shader Editor keeps popping up over Animation tab
Labels: bug,topic:editor,confirmed,regression

### Tested versions

- Reproducible in 4.4dev5

### System information

Godot v4.4.dev5 - Windows 10.0.19045 - Single-window, 1 monitor - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (NVIDIA; 32.0.15.6094) - AMD Ryzen 7 5800X 8-Core Processor (16 threads)

### Issue description

The UX of the bottom panel could greatly benefit from improvement. To keep this report contained to a single issue, here's something I've just run into:

when I want to edit an animation frame, I select the Sprite2D node to edit the keyframe - but then the animation panel switches over to the shader panel, so I have to switch back again before I can edit the keyframes.

https://github.com/user-attachments/assets/532f025d-314b-4e50-996f-60f99939654f


### Steps to reproduce

- make a Scene with both a Sprite2D, and an AnimationPlayer operating on that Sprite2D.
- add a Shader to the Sprite2D.
- create an animation in the AnimationPlayer.
- with the Animation panel open, try to select the sprite2D.
- contrary to what you'd expect, when you select the Sprite2D, the Shader Editor panel pops up, requiring you to switch to the Animation panel again before you can actually edit the keyframes.

(this seems to only happen after reopening the project?)

### Minimal reproduction project (MRP)

[mrp.zip](https://github.com/user-attachments/files/17940482/mrp.zip)
Repository: angular
Issue: Support i18n boolean expression in template
Labels: area: i18n

### Which @angular/* package(s) are relevant/related to the feature request?

localize

### Description

It is very common to translate the following:
```
<button>{{ active ? 'On' : 'Off' }}</button>
```

And the easiest way is to use the [select clause ICU expression](https://angular.dev/guide/i18n/prepare#mark-alternates-and-nested-expressions) like this:

```
<button i18n>{ active, select, true { On } false { Off } }</button>
```

but the documentation says:
> The select clause marks choices for alternate text based on your defined <ins>**string values**</ins>.

In my case, `active` property is a boolean and I'm using true/false like it's a boolean selection_category but it is actually interpreted as text. 

Is this usage officially supported or is this a strange/hacky case that just happens to work because of boolean to string conversion?


### Proposed solution

Either:
1. Explicitly say in the documentation that using the select ICU expression with a boolean property is supported and provide an example.
   - In that case, could the select clause be compile checked to make sure true and false categories, and only true and false, are specified?
3. Create a specific boolean ICU expression, for example: `{ active, bool, true { On } false { Off } } `
4. Add support for `$localize` and back quotes (`` ` ``) in template to be able to do: ``<button>{{ active ? $localize`On` : $localize`Off` }}</button>``

### Alternatives considered

We can define a method in the component and use it like that:
```
export class ExampleComponent {
   active: boolean;
   getActiveText(): string {
      return active ? $localize`On` : $localize`Off`
   }
}
```
```
<button>{{ getActiveText() }}</button>
```

But it will tend to complicate your component script with a lot of meaningless methods, and I feel that this use case could be simplified.
Repository: rust
Issue: Confusing error message when using Borrow'd keys in Hashmap
Labels: A-diagnostics,T-compiler

### Code

```Rust
use std::borrow::Borrow;
use bumpalo::Bump;
use std::collections::HashSet;

#[derive(PartialEq, Eq, Hash)]
struct Board; 

#[derive(PartialEq, Eq, Hash)]
struct TreeNode<'a> {
    state: Board, 
    foo: &'a ()
}

impl Borrow<Board> for TreeNode<'_> {
    fn borrow(&self) -> &Board {
        &self.state
    }
}

// Reduced for clarity
fn new_from_bump<'b>(state: Board, alloc: &'b Bump, cache: &HashSet<&'b TreeNode>) {
        cache.contains(&state);
}
```

### Current output

```Shell
error[E0277]: the trait bound `&TreeNode<'_>: Borrow<Board>` is not satisfied
   --> src/lib.rs:22:24
    |
22  |         cache.contains(&state);
    |               -------- ^^^^^^ the trait `Borrow<Board>` is not implemented for `&TreeNode<'_>`
    |               |
    |               required by a bound introduced by this call
    |
note: required by a bound in `HashSet::<T, S>::contains`
   --> /playground/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/set.rs:671:12
    |
669 |     pub fn contains<Q: ?Sized>(&self, value: &Q) -> bool
    |            -------- required by a bound in this associated function
670 |     where
671 |         T: Borrow<Q>,
    |            ^^^^^^^^^ required by this bound in `HashSet::<T, S>::contains`
help: consider removing the leading `&`-reference
    |
22  -         cache.contains(&state);
22  +         cache.contains(state);
    |
```

### Rationale and extra context

I'm not confident I'm interpreting this correctly, but I *think* this error message is misleading because the signature of `contains` implies that the `Borrow` implementation needs to be on the type `Q=Board`. Additionally, taking the suggestion of removing the & leads to an error because the parameter needs to be a `&Q` and there's no valid type for `Q` that makes `&Q` equal to `Board`. 

Changing the `Borrow` impl to instead be `for &TreeNode` *does* work, but looking at the docs, this isn't consistent with the general concept of the trait or the other examples in stdlib so I feel like it's not the right answer. If it is the right answer, the provided error message doesn't do anything to point me in that direction. 

### Rust Version

```Shell
❯ rustc --version --verbose
rustc 1.81.0 (eeb90cda1 2024-09-04)
binary: rustc
commit-hash: eeb90cda1969383f56a2637cbd3037bdf598841c
commit-date: 2024-09-04
host: x86_64-pc-windows-msvc
release: 1.81.0
LLVM version: 18.1.7
```
Repository: ollama
Issue: Deepseek (various) 236b crashes on run
Labels: bug,needs more info

### What is the issue?

Deepseek V2, V2.5, and V2-coder all crash with an OOM error when loading the 236b size.  Other versions of Deepseek may as well, that's all I've tested.  Hardware is dual A6000's with 48GB each.

```
Error: llama runner process has terminated: cudaMalloc failed: out of memory
ggml_gallocr_reserve_n: failed to allocate CUDA0 buffer of size 882903040
llama_new_context_with_model: failed to allocate compute buffers
```

### OS

Linux

### GPU

Nvidia

### CPU

AMD

### Ollama version

v0.4.5
Repository: ui
Issue: [feat]: Adapting new Tailwind CSS v4.0 Beta
Labels: area: request

### Feature description

### Why adapting?

The public release of Tailwind [CSS v4.0 Beta is out,](https://tailwindcss.com/docs/v4-beta#css-first-configuration) and I am thrilled with the new performance enhancements and features. There are so many global CSS features I'm excited to use, such as:

- [3D Transform](https://tailwindcss.com/docs/v4-beta#3-d-transforms)
- [`field-sizing` utilities](https://tailwindcss.com/docs/v4-beta#field-sizing-utilities)
- [Linear Gradient](https://tailwindcss.com/docs/v4-beta#linear-gradient-angles)

### The speed improvements are also quite impressive

![image](https://github.com/user-attachments/assets/aa421e40-e8ef-4ddd-9fac-13b93efb8231)

It still requires some configuration to achieve that performance.

### Hope you adapting this beta version

maybe you can add new choose to using `tailwindcss` v4.0 or a way to update to this version

### Affected component/components

Tailwind CSS

### Additional Context

Check out the [Theo react video](https://www.youtube.com/watch?v=q55u3_Nj3Lw) for more insights.

### Before submitting

- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues and PRs
Repository: electron
Issue: [Docs] Document `view.setLayout()`
Labels: enhancement :sparkles:

### Preflight Checklist

- [x] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [x] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [x] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Problem Description

There is an undocumented `view.setLayout()` function that seems to be used by some apps.

See https://github.com/electron/electron/pull/43069.

### Proposed Solution

Document it.

### Alternatives Considered

N/A

### Additional Information

_No response_
Repository: transformers
Issue: How to Log Training Loss at Step Zero in Hugging Face Trainer or SFT Trainer?
Labels: Feature request

### Feature request

log train loss on start

----

’m using the Hugging Face `Trainer` (or `SFTTrainer`) for fine-tuning, and I want to log the training loss at step 0 (before any training steps are executed). I know there’s an `eval_on_start` option for evaluation, but I couldn't find a direct equivalent for training loss logging at the beginning of training.

Is there a way to log the initial training loss at step zero (before any updates) using `Trainer` or `SFTTrainer`? Ideally, I'd like something similar to `eval_on_start`.

Here’s what I’ve tried so far:

#### Solution 1: Custom Callback

I implemented a custom callback to log the training loss at the start of training:


```python
from transformers import TrainerCallback

class TrainOnStartCallback(TrainerCallback):
    def on_train_begin(self, args, state, control, logs=None, **kwargs):
        # Log training loss at step 0
        logs = logs or {}
        logs["train/loss"] = None  # Replace None with an initial value if available
        logs["train/global_step"] = 0
        self.log(logs)

    def log(self, logs):
        print(f"Logging at start: {logs}")
        wandb.log(logs)

# Adding the callback to the Trainer
trainer = SFTTrainer(
    model=model,
    tokenizer=tokenizer,
    train_dataset=train_dataset,
    eval_dataset=eval_dataset,
    args=training_args,
    optimizers=(optimizer, scheduler),
    callbacks=[TrainOnStartCallback()],
)
```
This works but feels a bit overkill. It logs metrics at the start of training before any steps.

#### Solution 2: Manual Logging

Alternatively, I manually log the training loss before starting training:

```python
wandb.log({"train/loss": None, "train/global_step": 0})
trainer.train()
```

### Question:

Are there any built-in features in `Trainer` or `SFTTrainer` to log training loss at step zero? Or is a custom callback or manual logging the best solution here? If so, are there better ways to implement this functionality? similar to the `eval_on_start` but `train_on_start`?

cross: https://discuss.huggingface.co/t/how-to-log-training-loss-at-step-zero-in-hugging-face-trainer-or-sft-trainer/128188

### Motivation

Crucial sanity check

### Your contribution

yes, happy to implement this.
Repository: PowerToys
Issue: PowerToys fails to build on local machine
Labels: Issue-Bug,Needs-Triage

![Screenshot of the error message in Visual Studio when building PowerToys](https://github.com/user-attachments/assets/febcd2a3-faa5-4e17-83e4-6ef4284716cf)

PowerToys fails to build on local machine due to, what seems like, a WinAppSDK generated file.

```
PRI175: 0x80073b0f - Processing Resources failed with error: Duplicate Entry.
PRI277: 0x80073b0f - Conflicting values for resource 'Microsoft.UI.Xaml/Resources/WarningSuitableWebView2NotFound'
```

For both, the project is `MeasureToolUI` and the file is `WINAPPSDKGENERATEPROJECTPRIFILE`.

This is in `Debug` build profile, with Visual Studio 2022 17.12.