sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: HashMap reallocates even though capacity is not exceeded
Labels: A-collections,T-libs-api,A-docs,C-bug,T-libs

`HashMap::with_capacity`'s documentation states:

> The hash map will be able to hold at least `capacity` elements without reallocating. This method is allowed to allocate for more elements than `capacity`.

This statement is incorrect as the following code demonstrates.

```rust
fn main() {
    let initial_capacity = 100;
    let mut a = std::collections::HashMap::<u32, ()>::with_capacity(initial_capacity);
    let mut current_capacity = initial_capacity;
    for i in 0..1_000 {
        let new_capacity = a.capacity();
        if new_capacity != current_capacity {
            println!("iteration {i}, new capacity {new_capacity}");
            current_capacity = a.capacity();
        }

        assert!(a.len() < initial_capacity);
        a.insert(i, ());
        if a.len() == initial_capacity {
            a.remove(&i).unwrap();
        }
    }
}
```

A possible output of this program is as follows. It is a *possible* output because the default hasher is randomly seeded. You can make it deterministic with a custom hasher.

```
iteration 0, new capacity 112
iteration 100, new capacity 111
iteration 101, new capacity 110
iteration 105, new capacity 109
iteration 109, new capacity 108
iteration 111, new capacity 107
iteration 125, new capacity 106
iteration 137, new capacity 105
iteration 138, new capacity 104
iteration 141, new capacity 103
iteration 165, new capacity 102
iteration 187, new capacity 101
iteration 188, new capacity 100
iteration 252, new capacity 99
iteration 253, new capacity 224
```

As you can see in the output the capacity jumps from the initial 112 to 224 in iteration 253. This means the HashMap has allocated more memory. However, as the assert shows, the HashMap never held more elements than the initial capacity. This violates the guarantee documented in `with_capacity`.

This is a bug in hashbrown. I've opened an issue there too https://github.com/rust-lang/hashbrown/issues/602 .
Repository: PowerToys
Issue: PowerToys Run shows black text on black background
Labels: Issue-Bug,Product-PowerToys Run,Needs-Triage,Needs-Team-Response

### Microsoft PowerToys version

0.87.0

### Installation method

PowerToys auto-update

### Running as admin

No

### Area(s) with issue?

PowerToys Run

### Steps to reproduce

When opening PowerToys Run (using Alt + Space) I get the input window, but I can't see my input or the results because everything is black except the application icons. 

This occurs regardless of whether I have Windows set to Light or Dark mode. This started after the last update (to v 0.87.0), before that I got a light colored input with black text.

### ✔️ Expected Behavior

I'm expecting the input to look like it used to, like on the [PowerToys Run page](https://learn.microsoft.com/en-us/windows/powertoys/run)

### ❌ Actual Behavior

![Image](https://github.com/user-attachments/assets/d06bd313-e396-45d8-a55e-80ed89df943d)



### Other Software

_No response_
Repository: vscode
Issue: ERR [189] potential listener LEAK detected, having 248 listeners already. MOST frequent listener (33)
Labels: bug,freeze-slow-crash-leak,performance

This originates here

https://github.com/microsoft/vscode/blob/777fd07cccc3de449e529c9f701c2cfdd36ecb3e/src/vs/workbench/contrib/search/browser/searchResultsView.ts#L296


```
ERR [189] potential listener LEAK detected, having 248 listeners already. MOST frequent listener (33):: Error
    at Zhi.create (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:25:11828)
    at $Te.q [as onDidChange] (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:28:1110)
    at Object.u [as onWillAddFirstListener] (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:403:109650)
    at Tse.q [as onDidChange] (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:28:1298)
    at new vc (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:403:114399)
    at kdt.o (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1334:1586)
    at kdt.createInstance (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:1334:1083)
    at Uve.renderTemplate (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:2080:14897)
    at jOi.renderTemplate (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:411:36628)
    at REt.renderTemplate (vscode-file://vscode-app/Applications/Visual%20Studio%20Code%20-%20Insiders.app/Contents/Resources/app/out/vs/workbench/workbench.desktop.main.js:411:16131)
```
Repository: ant-design
Issue: Facing issue of SyntaxError: Unexpected token 'export' when import antd any component in Next.js app
Labels: unconfirmed

### Reproduction link

[https://github.com/prakashmallow/test-with-antd/tree/main](https://github.com/prakashmallow/test-with-antd/tree/main)

### Steps to reproduce

1. Clone the above Next.js app locally
2. Install dependencies with the `yarn install` or `npm install` command in the IDE terminal with the project directory.
3. Run `next dev` or `next build`
4. The issue is occurring

### What is expected?

Without any error while running the `next dev` and no issues with the `next build` while using the antd package in the Next.js project.

### What is actually happening?

When running the `next dev` and `next build` using the antd package in the Next.js project the below error throws
`SyntaxError: Unexpected token 'export'`
<img width="1440" alt="Screenshot 2024-12-18 at 3 28 21 PM" src="https://github.com/user-attachments/assets/5f718a33-86b4-426c-a4c8-a0a962b0f8ba" />
<img width="1440" alt="Screenshot 2024-12-18 at 3 28 32 PM" src="https://github.com/user-attachments/assets/1b019d55-a500-45f8-9974-35aa8967629a" />
<img width="1440" alt="Screenshot 2024-12-18 at 4 24 06 PM" src="https://github.com/user-attachments/assets/04f4cf3a-89ce-4828-b978-4f9816f85e3d" />

| Environment | Info |
| --- | --- |
| next | 15.1.1 |
| antd | 5.22.5 |
| @ant-design/cssinjs | 1.22.1 |
| React | 19 |
| System | macOS |
| Browser | Chrome |

---
Nextjs version 15.1.0 and 15.1.1

<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: kubernetes
Issue: informer list and watch keep str error log:too old resource version
Labels: kind/bug,needs-sig,needs-triage

### What happened?

informer list and watch keep str error log:too old resource version
resourceVersion stay at the same value. 

### What did you expect to happen?

when watch have error:too old resource version,resourceVersion will change other value.
informer recovery available.


### How can we reproduce it (as minimally and precisely as possible)?

maybe etcd leader changed.

### Anything else we need to know?


if a list request have resourceVersion and have limit or continue,apiserver will query it from etcd and return request resourceVersion.
for example 
https://qqqq6443/api/v1/nodes?resourceVersion=1111&limit=10
response resourseVersion will is 1111.


informer
1.use page.list() to list resource from apiserver.
2.get resourceVersion from 1 result.
3.use resourceVersion to watch from apiserver.


then informer page.list will always return 1111.
watch will always std err too old resource version.
### Kubernetes version

<details>

```console
$ kubectl version
# paste output here
```

</details>


### Cloud provider

<details>

</details>


### OS version

<details>

```console
# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here
```

</details>


### Install tools

<details>

</details>


### Container runtime (CRI) and version (if applicable)

<details>

</details>


### Related plugins (CNI, CSI, ...) and versions (if applicable)

<details>

</details>
Repository: rust
Issue: unhelpful E0277 when writing `func(&a: &T)` instead of `func(a: &T)`
Labels: A-diagnostics,T-compiler

### Code

```Rust
use std::path::Path;

fn main() {
    fun_with_path(&Path::new("."));
    fun_with_int(&0);
}

// &a: &Path    should've been a: &Path
pub fn fun_with_path(&a: &Path) {
    println!("{:?}", a);
}

// ok 
pub fn fun_with_int(&a: &i32) {
    println!("{:?}", a);
}
```

### Current output

```Shell
Compiling playground v0.0.1 (/playground)
error[E0277]: the size for values of type `[u8]` cannot be known at compilation time
    --> src/main.rs:9:23
     |
9    | pub fn fun_with_path(&a: &Path) {
     |                       ^ doesn't have a size known at compile-time
     |
     = help: within `Path`, the trait `Sized` is not implemented for `[u8]`
note: required because it appears within the type `Path`
    --> /playground/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/path.rs:2137:12
     |
2137 | pub struct Path {
     |            ^^^^
     = note: all local variables must have a statically known size
     = help: unsized locals are gated as an unstable feature

For more information about this error, try `rustc --explain E0277`.
error: could not compile `playground` (bin "playground") due to 1 previous error
```

### Desired output

```Shell
point at the `&` of `&a` in `fun_with_path` and suggest removing it?
```

### Rationale and extra context

_No response_

### Other cases

```Rust

```

### Rust Version

```Shell
rustc 1.85.0-nightly (a4cb3c831 2024-12-17)
binary: rustc
commit-hash: a4cb3c831823d9baa56c3d90514b75b2660116fa
commit-date: 2024-12-17
host: x86_64-unknown-linux-gnu
release: 1.85.0-nightly
LLVM version: 19.1.5
```

### Anything else?

_No response_
Repository: PowerToys
Issue: [PowerToys Run] Dialogue box only draggable by magnifying glass
Labels: Issue-Bug,Product-PowerToys Run,Resolution-Fix Committed

### Microsoft PowerToys version

0.87.0

### Installation method

PowerToys auto-update

### Running as admin

None

### Area(s) with issue?

PowerToys Run

### Steps to reproduce

1. Turn on the PowerToys Run feature
2. Activate the shortcut to open the dialogue box
3. Attempt to drag the dialogue box (it won't move unless you drag it from the magnifying glass icon)

### ✔️ Expected Behavior

Previously I was able to drag the PowerToys Run dialogue box around my screen, but I can't as of v0.87.0.
This might've been intentional I suppose. If it was, an option to turn it back on would be greatly appreciated.

**EDIT: It's still draggable from the magnifying glass (thanks Davide). Might be nice to have it draggable from other places as well, but not as important of a bug anymore.**

### ❌ Actual Behavior

_No response_

### Other Software

_No response_
Repository: flutter
Issue: [pigeon] Allow generics in data classes, with concrete types at the `Api` level 
Labels: package,c: proposal,team-ecosystem,p: pigeon,P3,triaged-ecosystem

### Use case

Defining custom argument types would be very helpful to reduce code duplication. Nothing special about that just more Generics support. The only supported types should be primitives such as int, string etc and declared within pigeon file.

### Proposal

Opportunity to generate Apis using such classes (at least for Kotlin/Swift) 

```dart
class A<T> {
  final List<T> list;
  final T value;

  A({required this.list, required this.value});
}

sealed class Option<T> {}

class Some<T> extends Option<T> {
  final T value;

  Some({required this.value});
}

class None<T> extends Option<T> {}
```

Actually we know that in HostApi/FlutterApi only known types are used, either are generated or predefined (int, bool, String etc), so it is possible to implement such feature.
Repository: ollama
Issue: Clarification: "format" vs "tools" behaviours
Labels: bug

### What is the issue?

Structured output formatting was recently released. There are now 2 different ways of structuring your output:

1. Pass a schema to the "format" argument to the API.
2. Convert the schema to a tool and pass it to the "tools" argument to the API.

I understand that semantically, for structured output, it would make more sense to use the "format" option, whereas for tool use, the "tools" argument is more sensible.
My question is if there is any difference under the hood?

Specifically, I have the following questions:

- Does `tools` insert the tool into the prompt using the tool tokens in the model chat template?
- Does "format" insert the tool into the prompt using the tool tokens in the model chat template?
- Does "format" ensure that the schema is respected, or only that the output is "json", but not necessarily "json" that complies to the schema? Is the behaviour exactly the same for "tools", or is there a difference?


### OS

Linux

### GPU

_No response_

### CPU

_No response_

### Ollama version

0.5.4
Repository: three.js
Issue: Honor camera layers on light.shadow.camera for selective shadow
Labels: Suggestion

### Description

In order to build a selective real time shadow along with a baked shadow system the light.shadow.camera should honor the layers to be tested against an object to render the shadow

I did add support on a custom build of the WebGLRenderer and this was very handy 



Here an example disabling all the layers for the shadow camera but still renders : 

[Live Link](https://jsfiddle.net/uwpyqoe4/6/)

### Solution

Before rendering the shadow, the mask is copied from the main render camera, wondering if this copy is mandatory, and if we could go with manually setting the layers instead for more controls, or maybe provide a solution to play with the shadow.camera layer without being overwritten :

[https://github.com/mrdoob/three.js/blob/672d77ab93218a00555331db45ffc19055c1fe59/src/nodes/lighting/ShadowNode.js#L659](https://github.com/mrdoob/three.js/blob/672d77ab93218a00555331db45ffc19055c1fe59/src/nodes/lighting/ShadowNode.js#L659)
Repository: excalidraw
Issue: Adding Entity-Relationship Diagram Symbols and Notation
Labels: enhancement

It would be immensly usefull for data modelling. I'm pretty sure it's not too much work, so if anyone can do this (my knowledge doesn't extend to js), I'd be thankfull! <3

![Image](https://github.com/user-attachments/assets/77a5ceef-3280-423a-89f2-f6a9b68f0934)
Repository: kubernetes
Issue: On namespace deletion send sigterm to pods first
Labels: kind/feature,needs-sig,needs-triage

### What would you like to be added?

After sending a request to the Kubernetes API to delete a namespace, the pods within the namespace are reporting an error (golang app) while trying to reach another pod in the cluster:

```
dial tcp 10.43.16.12:80: connect: connection refused
```

I was expecting a context Cancelled error in my app as the request is passed a context that listens for SIGTERM. It seems when a namespace is deleted, it starts by deleting endpoints, services etc. before sending the SIGTERM which results in the app not knowing that it should be shutting down. 

### Why is this needed?

Without a SIGTERM the pods in the deployment continue to try and operate while their namespace environment is shutting down, leading to errors and data loss. 

Considered sending a deployment delete request before the namespace delete but it adds an extra API call. 

Would be helpful to know how the order of deletion occurs, and potentially look to revise the order to ensure pods receive the SIGTERM first.
Repository: transformers
Issue: Deepseek v2
Labels: New model

### Model description

There is stale PR https://github.com/huggingface/transformers/pull/31976. Is anybody working on this model? 

### Open source status

- [x] The model implementation is available
- [x] The model weights are available

### Provide useful links for the implementation

_No response_
Repository: PowerToys
Issue: Change Keyboard Language when specific hardware is detected
Labels: Idea-New PowerToy,Needs-Triage

### Description of the new feature / enhancement

#Product-Keyboard Shortcut Manager

As a Brazilian, who has lived in the US and now lives in Spain, one of the most annoying things I have to deal with my work computer is that all my home keyboards are US-layout ones, and the keyboard in the work laptop is in Spanish.
I can type in both, no problem, but I have to select a default language (US-International) and when I'm using the other keyboard, I have to manually change the language to Spanish every time the computer sleeps, or I close the lid. Many questions in morning chats are ended with `_` instead of `?` because of that 🫤...

The request is to have a program running that detects the keyboard being typed on (maybe based on model or serial number), and switches to the last selected language for that keyboard, in a similar way that Windows remembers the monitor layout and resolution when you plug the same set-up after having worked in a different place. 
Alternatively, it could detect a new plugged layout and change the global layout configuration for the computer to the latest one selected for that set of plugged-in keyboards. This would eliminate the need to have more than one layout active at a time, but would not fix the issue that pressing a `Ç` in my Spanish keyboard while having the US-Intl layout selected for the wireless keyboard actually produces a `\`

### Scenario when this would be used?

Used for people that, like me, have multiple keyboard keyboard layouts throughout the day (at different desks / docks for example).

### Supporting information

I searched around, and can't find anything that does this... the closest I got are these 2 answers from the foruns, but don't really address the issue 
https://answers.microsoft.com/en-us/windows/forum/all/changing-keyboard-when-docked/1b0f269a-8898-41ef-8aa7-e7dc20f6490b
https://answers.microsoft.com/en-us/windows/forum/windows_7-hardware/changing-docked-profile/ae909c40-3383-4daa-b136-fe8a1d8619e8
Repository: material-ui
Issue: [docs] Add TanStack Router examples
Labels: docs,waiting for 👍,support: docs-feedback

### Related page

https://mui.com/material-ui/integrations/routing/#react-router-examples

### Kind of issue

Missing information

### Issue description

It is not clear how to combine the TanStack router `<Link>` component with MUI components. One could add examples below the examples for React Router

### Context

I want to use typesafe routing via TanStack `Link` components but want to keep the MUI styled `Link` component. Since this is not possible

```
    <Link to="/" style={{ textDecoration: 'none', color: 'inherit' }}>
      <MuiLink underline="hover" color="inherit">
        Tanstack Link rendered as MUI Link
      </MuiLink>
    </Link>
```

( because you can't render <a> inside <a> ) it would be awesome if the docs would have some examples on how to "embed" TanStack routing components inside MUI elements to keep the MUI look.

**Search keywords**: TanStack
Repository: ant-design
Issue: Watermark 水印组件多次渲染导致页面卡死
Labels: 🐛 Bug,help wanted

### Reproduction link

[https://codepen.io/linong/pen/MYgpbae?editors=001](https://codepen.io/linong/pen/MYgpbae?editors=001)

### Steps to reproduce

1. 点击覆盖按钮，这个按钮是覆盖 toDataURL，模拟响应较慢的场景。
2. 修改水印文案
3. 观察控制台，会发现console被多次触发。

### What is expected?

console 只触发一次

### What is actually happening?

console 触发了多次，导致页面被卡死

| Environment | Info |
| --- | --- |
| antd | 5.22.5 |
| React | 18 |
| System | macOS 14.6.1 (23G93) |
| Browser | 版本 120.0.6099.234（正式版本） (arm64) |

---
我看到了一个类似的问题，https://github.com/ant-design/ant-design/issues/46765。

<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: flutter
Issue: CupertinoContextMenu is not interactible until the long press gesture is released
Labels: framework,f: cupertino,has reproducible steps,P2,would require significant investment,team-design,triaged-design,found in release: 3.27,found in release: 3.28

### Use case

CupertinoContextMenu has a major native distinguish behavior in the dragging process.

Current behavior:
1 - When user long press on item the context appear but there is no interacting.
2 - The User need to release his finger and repress the preview area to interact with the menu.

https://github.com/user-attachments/assets/1a3de1a5-1540-47e9-8617-f3c224995625


The expected behavior:
1 - When user long press on item the context menu should appear
2 - While user finger keep finger down and swap the menu should keep interacting scrolling.

https://github.com/user-attachments/assets/0413149c-771b-4c9b-b4a8-16f7b4a0ca51

In both videos i does not released my finger after popup appear, you can reproduce this misbehave by keep your finger pressed down until pop-up show and try to move your finger around.

Also the drag cancel time is not same as the native, but this is not our topic today , as i see in the source code, there is a constants holding timing for drag, speed .. etc , so it well be easy to make this calibration latter.

### Proposal

I guess we need somehow a way to track the global gesture position , and pass it from the child to the parent and keep synchronizing tracking while preview showing.
I really thinking about solve this issue, but it need more digging to collect more information's about the reflection of IOS accessibility preferences and there impact on the context menu.
If any one have any suggestions that could help, please share them  to discuss.
Repository: rust
Issue: Slice bounds check not elided in trivial case when using a local varaible outside of a branch
Labels: A-LLVM,I-slow,T-compiler,llvm-fixed-upstream,C-optimization

I tried this code:

```rust
fn last_four(s: &[u8]) -> &[u8] {
    let start = if s.len() <= 4 {
        0
    } else {
        s.len() - 4
    };
    &s[start..]
}
```

Which produces the following assembly on x86_64:

```
last_four:
        mov     rax, rdi
        lea     rcx, [rsi - 4]
        xor     edi, edi
        cmp     rsi, 5
        cmovae  rdi, rcx
        mov     rdx, rsi
        sub     rdx, rdi
        jb      .LBB0_2
        add     rax, rdi
        ret
.LBB0_2:
        push    rax
        lea     rdx, [rip + .L__unnamed_1]
        call    qword ptr [rip + core::slice::index::slice_start_index_len_fail::hda7fe0c134770be5@GOTPCREL]

.L__unnamed_2:
        .ascii  "/app/example.rs"

.L__unnamed_1:
        .quad   .L__unnamed_2
        .asciz  "\017\000\000\000\000\000\000\000\b\000\000\000\007\000\000"
```

The branch with the call to `slice_start_index_len_fail` should be unreachable.

Indeed, I can remove it by moving the slice operation inside the `if` statement:

```rust
fn last_four(s: &[u8]) -> &[u8] {
    if s.len() <= 4 {
        &s[0..]
    } else {
        &s[s.len() - 4..]
    }
}
```

Which gives:

```
last_four:
        cmp     rsi, 5
        lea     rax, [rdi + rsi - 4]
        mov     edx, 4
        cmovb   rdx, rsi
        cmovb   rax, rdi
        ret
```

Which is what I expected.