sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Inconsistent key type inference when spreading objects with const assertion into plain objects
Labels: Help Wanted,Possible Improvement

### 🔎 Search Terms

const assertion, type inference, as const, object keys, type conversion, keyof typeof, satisfies, spread, readonly object

### 🕗 Version & Regression Information

- This is the behavior in every version I tried, and I reviewed the FAQ for entries about keyof, as const, infererence etc.


### ⏯ Playground Link

[Playground](https://www.typescriptlang.org/play/?ts=5.5.2#code/MYewdgzgLgBGCGBbAphAQgTwJIBMYF4YBvAKBnJgEYAuGAIgCkQALMGAERGToBoyKATLUbwwyGAGVEASyjNe-cgGZhAQQA2yAB4wmrCOAUUYAFmEBZeACdp8GAHFrwWwoC+MeBBihIsCPChpCAAzaVQYACVkUCscAB4wAFdEACNkKx4YaBswAHMAPgBuEhIoDAAHcVwvQgBrZAwQYJgyyqa4JFRMXGKAel6KAD0AfhKfaA6UdGwcAGEQcowCYkUYADoNhCnunD53f0CQsK8omPik1PTM7Ok8opLWqpwIecXl+sbmx-atrpnXjB9AbkEZAA)

### 💻 Code

```ts
const namesById = {
  1: "John Doe",
  2: "Jane Smith",
  3: "Alex Johnson",
  4: "Maria Garcia",
} as const satisfies Record<number, string>;

type Ids = keyof typeof namesById;
//   ^? type Ids = 1 | 2 | 3 | 4

const namesByIdCopy = {
  ...namesById,
} satisfies Record<number, string>;

type IdsCopy = keyof typeof namesByIdCopy;
//   ^? type IdsCopy = "1" | "2" | "3" | "4"

```


### 🙁 Actual behavior

`IdsCopy` has converted all of the keys to string literal union instead of a number literal union when using `keyof typeof`, even despite the fact that we've used `satisfies Record<number, string>` on the `namesByIdCopy` object.

### 🙂 Expected behavior

```ts
type IdsCopy = keyof typeof namesByIdCopy;
//   ^? type IdsCopy = "1" | "2" | "3" | "4"
```

should instead be typed as:
```ts
type IdsCopy = keyof typeof namesByIdCopy;
//   ^? type IdsCopy = 1 | 2 | 3 | 4
```

### Additional information about the issue

The type inference seems to work as expected (i.e. numeric literal union) if `as const` is used on both the original object and the copy object, or if `as const` isn't used on the original object. It's only when spreading the object with  an`as const` and inferring the keys using `keyof typeof` that they get inferred incorrectly.
Repository: TypeScript
Issue: Please Allow return `void` of `set accessor`
Labels: Suggestion,In Discussion

### 🔍 Search Terms

set accessor , return, void

### ✅ Viability Checklist

- [X] This wouldn't be a breaking change in existing TypeScript/JavaScript code
- [X] This wouldn't change the runtime behavior of existing JavaScript code
- [X] This could be implemented without emitting different JS based on the types of the expressions
- [X] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- [X] This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- [X] This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals

### ⭐ Suggestion

For the following case, TypeScript 5.5.3 throws "A 'set' accessor cannot have a return type annotation." 
```ts
interface Foo {
  set foo (value: number): void
}
```

the 'void' is a special type ,  'set' accessor should be allowed to return it.
Because   I think  in TS  "Every function should/could have a return value , if it don't, please return `void` ."



### 📃 Motivating Example

I think , in a ts project , there should be a Uniform code specification, like this : 
"All  functions have return type , or  All functions don't have return type,  no exception" .

### 💻 Use Cases

make my project under a Uniform code specification.
Repository: node
Issue: Fast Allocation of `ArrayBuffer` with `maxByteLength`
Labels: buffer

Currently we have an optimization which turns off zero fill of `ArrayBuffers` during allocation through the `Buffer.allocUnsafeSlow` method:

```js
let zeroFill = getZeroFillToggle();
function createUnsafeBuffer(size) {
  zeroFill[0] = 0;
  try {
    return new FastBuffer(size);
  } finally {
    zeroFill[0] = 1;
  }
}
```

This can be used to quickly allocate `ArrayBuffer`s:

```js
const arrayBuffer = Buffer.allocateUnsafeSlow(size).buffer
```

The problem is that this does not allow allocating `ArrayBuffer`s with a specified `maxByteLength`:

```js
const arrayBuffer = new ArrayBuffer(size, { maxByteLength: capacity })
```

Could we add some way to perform the allocation similarly? Maybe an option to `Buffer.allocateUnsafeSlow`?
Repository: ollama
Issue: 通过Modelfile构建的模型run不起来
Labels: bug

### What is the issue?

NAME                            ID              SIZE    MODIFIED      
glm-4-9b-chat:latest            5356a47a9286    6.3 GB  3 minutes ago   
llama3:latest                   71a106a91016    4.7 GB  2 months ago    
llava:latest                    8dd30f6b0cb1    4.7 GB  2 months ago    
mistral:latest                  61e88e884507    4.1 GB  7 weeks ago     
phi3:latest                     a2c89ceaed85    2.3 GB  2 months ago    
qwen:1.8b                       b6e8ec2e7126    1.1 GB  2 months ago    
yi:6b                           a7f031bb846f    3.5 GB  7 weeks ago     
znbang/bge:large-zh-v1.5-f16    9020b4d2aeca    650 MB  2 months ago    
~$ ollama run glm-4-9b-chat:latest
Error: llama runner process no longer running: -1 
~$ ollama run phi3:latest
>>>

### OS

Linux

### GPU

Nvidia

### CPU

_No response_

### Ollama version

_No response_
Repository: pytorch
Issue: [symbolic-shapes] Guard validation in Dynamo changes the shape_env 
Labels: triaged,oncall: pt2,module: dynamic shapes

### 🐛 Describe the bug

`pytest test/dynamo/test_subclasses.py::SubclassTests::test_recompile_with_symbool_inputs`

Some background here - https://github.com/pytorch/pytorch/pull/118448#issuecomment-1917699499

### Error logs

_No response_

### Minified repro

_No response_

### Versions

NA

cc @ezyang @chauhang @penguinwu
Repository: pytorch
Issue: [tracker] Dynamo guard validation exposed issues
Labels: triaged,tracker,oncall: pt2

### 🐛 Describe the bug

Get this PR if not merged already - https://github.com/pytorch/pytorch/pull/118448

cc @ezyang @chauhang @penguinwu

```[tasklist]
### Tasks
- [ ] https://github.com/pytorch/pytorch/issues/129936
- [ ] https://github.com/pytorch/pytorch/issues/119338
- [x] https://github.com/pytorch/pytorch/issues/129938
- [ ] https://github.com/pytorch/pytorch/issues/129939
- [ ] PYTORCH_TEST_WITH_DYNAMO=1 pytest -vs test/functorch/test_aotdispatch.py::TestAOTModuleSimplified::test_aot_module_simplified_dynamic - Somehow the expr is reversed - Eq(s0, 20) becomes Eq(20, s0) after the guard expr is evaluated once.
- [ ] https://github.com/pytorch/pytorch/issues/130068
- [ ] https://github.com/pytorch/pytorch/issues/130066
```
Repository: kubernetes
Issue: The OpenAPI cache occupies a large amount of memory
Labels: kind/bug,sig/api-machinery,needs-kind,triage/accepted

### What happened?
![image](https://github.com/kubernetes/kubernetes/assets/54977497/83cd8cf0-1c54-4dd0-b093-cbc66833422c)
When the /openapi/v2 interface is invoked for the first time, the memory usage increases from 580 MB to about 690 MB. The memory usage remains between 690 MB and 700 MB. Do we need to optimize the memory usage?

### What did you expect to happen?

Clear the cache in time or optimize the memory usage.

### How can we reproduce it (as minimally and precisely as possible)?

Invoke the /openapi/v2 interface.

### Anything else we need to know?

_No response_

### Kubernetes version

<details>

```console
$ kubectl version
# paste output here
```
1.28
</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: PowerToys
Issue: Request for PowerRename
Labels: Issue-Bug,Needs-Triage

### Microsoft PowerToys version

0.81.1

### Installation method

Microsoft Store

### Running as admin

Yes

### Area(s) with issue?

PowerRename

### Steps to reproduce

It is consistent, as it happens every time on two separate computers running Windows 11. Desktop has Win11 Pro, the laptop has Win11 Home.

### ✔️ Expected Behavior

When choosing files for the PowerRename function with File Explorer as the program on top, one would expect the window to open on top of File Explorer.

### ❌ Actual Behavior

PowerRename actually opens in the center of the screen, below the File Explorer window. Depending on how large File Explorer is and where it is located, I have to click on the PowerRename icon on the taskbar or move File Explorer to the side to uncover the PowerRename window, which is slightly annoying every time one needs to use it.
[PowerToysReport_2024-07-02-08-14-27.zip](https://github.com/user-attachments/files/16063731/PowerToysReport_2024-07-02-08-14-27.zip)
![image](https://github.com/microsoft/PowerToys/assets/172979062/ddc7da4f-0b27-466d-bf1e-5ec6d5219bf8)


### Other Software

None
Repository: tensorflow
Issue: Advisory GHSA-84mw-34w6-2q43 contains wrong POC codes
Labels: stat:awaiting tensorflower,type:bug,comp:core

### Issue type

Documentation Bug

### Have you reproduced the bug with TensorFlow Nightly?

No

### Source

source

### TensorFlow version

N/A

### Custom code

No

### OS platform and distribution

N/A

### Mobile device

N/A

### Python version

N/A

### Bazel version

_No response_

### GCC/compiler version

_No response_

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

It seems that description of Gtihub advisory [GHSA-84mw-34w6-2q43](https://github.com/advisories/GHSA-84mw-34w6-2q43) contains POC codes from another advisory [GHSA-772p-x54p-hjrv](https://github.com/advisories/GHSA-772p-x54p-hjrv). This causes issues in understanding the vulnerability.

### Standalone code to reproduce the issue

```shell
N/A
```


### Relevant log output

_No response_
Repository: angular
Issue: Mark FormControlDirective as standalone
Labels: area: forms

### Which @angular/* package(s) are relevant/related to the feature request?

forms

### Description

It would be nice, if possible, to mark the FormControlDirective as a standalone component. That way it can be used as hostDirective in other components. For instance, we are using it (with workaround), to dynamically render and bind form-inputs.  

Currently the following error is shown when the directive is used as host-directive.

`[ERROR] TS-992014: Host directive FormControlDirective must be standalone [plugin angular-compiler]`

![image](https://github.com/angular/angular/assets/138445519/c0dd6859-088e-4fab-b6fc-72531ee3f1c7)

With the following piece of code

```
hostDirectives: [ {
  directive: FormControlDirective,
  inputs: [ 'formControl' ]
} ]
```

### Proposed solution

Mark FormControlDirective as standalone

### Alternatives considered

Currently we extend the FormControlDirective, so it can be marked to as standalone without any other changes. That custom component we can than use as HostDirective.

```
import { Directive } from '@angular/core';
import { FormControlDirective } from '@angular/forms';

@Directive( {
  standalone: true
} )
export class HostFormControlDirective extends FormControlDirective {
}
```

[stackblitz example](https://stackblitz.com/edit/angular-issue-56805?file=src%2Fexample%2Fexample.component.ts)
Repository: next.js
Issue: Next.js does not understand TypeScript project references
Labels: bug,TypeScript

### Link to the code that reproduces this issue

https://github.com/remcohaszing/recma-nextjs-static-props/tree/3944549ef8923e91bb3a8ee2542fbc4e67a69e9b

### To Reproduce

1. Clone the project, checkout the broken commit, and install.
   ```sh
   git clone https://github.com/remcohaszing/recma-nextjs-static-props.git
   cd recma-nextjs-static-props
   git checkout 3944549ef8923e91bb3a8ee2542fbc4e67a69e9b
   npm ci
   ```
2. Validate the project with TypeScript.
   ```sh
   npx tsc --build
   ```
3. Great! That works. Now clean up.
   ```sh
   npx tsc --build --clean
   ```
4. Build the project with Next.js.
   ```sh
   npx next build
   ```
5. Observe the type error.
   ```$ next build       
     ▲ Next.js 14.2.4

      Linting and checking validity of types  ...Failed to compile.

   ./fixtures/custom-name/options.js:2:51
   Type error: Could not find a declaration file for module 'recma-nextjs-static-props'. 
   '/home/remco/Projects/recma-nextjs-static-props/lib/recma-nextjs-static-props.js' implicitly has an 'any' type.
     Try `npm i --save-dev @types/recma-nextjs-static-props` if it exists or add a new declaration (.d.ts) file containing `declare module 'recma-nextjs-static-props';`

     1 | /**
   > 2 |  * @import { RecmaNextjsStaticPropsOptions } from 'recma-nextjs-static-props'
       |                                                   ^
     3 |  */
     4 |
     5 | /**
   ```

### Current vs. Expected behavior

If `tsc --build` works, I expect `next build` to not throw type errors. The likely culprit is that `next build` doesn’t understand TypeScript [project references](https://www.typescriptlang.org/docs/handbook/project-references.html).

### Provide environment information

```bash
Operating System:
  Platform: linux
  Arch: x64
  Version: #202405300957~1718348209~22.04~7817b67 SMP PREEMPT_DYNAMIC Mon J
  Available memory (MB): 31807
  Available CPU cores: 12
Binaries:
  Node: 22.3.0
  npm: 10.8.1
  Yarn: 1.22.22
  pnpm: 9.4.0
Relevant Packages:
  next: 14.2.4 // Latest available version is detected (14.2.4).
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.5.2
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

TypeScript

### Which stage(s) are affected? (Select all that apply)

next build (local), Vercel (Deployed)

### Additional context

As a workaround, users can add the following to `next.config.mjs`:

```js
export default {
  typescript: {
    ignoreBuildErrors: true
  }
}
```
Repository: tensorflow
Issue: Build error in tensorflow lite minimal example
Labels: stat:contribution welcome,awaiting review,type:build/install,comp:lite,TF 2.16

### Issue type

Build/Install

### Have you reproduced the bug with TensorFlow Nightly?

Yes

### Source

source

### TensorFlow version

2.16.2

### Custom code

No

### OS platform and distribution

Linux Ubuntu 22.04

### Mobile device

_No response_

### Python version

_No response_

### Bazel version

_No response_

### GCC/compiler version

11.4.0

### CUDA/cuDNN version

_No response_

### GPU model and memory

_No response_

### Current behavior?

Following guide at https://github.com/tensorflow/tensorflow/tree/master/tensorflow/lite/examples/minimal

Did not modify any files. The build step (5) fails with an undefined reference error (see log outputs).
Building standalone tensorflow lite with cmake following https://www.tensorflow.org/lite/guide/build_cmake works just fine.


### Standalone code to reproduce the issue

```shell
sudo apt-get install cmake
wget http://es.archive.ubuntu.com/ubuntu/pool/main/libf/libffi/libffi7_3.3-4_amd64.deb
sudo dpkg -i libffi7_3.3-4_amd64.deb
git clone https://github.com/tensorflow/tensorflow.git tensorflow_src
mkdir minimal_build
cd minimal_build
cmake ../tensorflow_src/tensorflow/lite/examples/minimal
cmake --build . -j
```


### Relevant log output

```shell
[100%] Built target tensorflow-lite
[100%] Building CXX object CMakeFiles/minimal.dir/minimal.cc.o
[100%] Linking CXX executable minimal
/usr/bin/ld: tensorflow-lite/libtensorflow-lite.a(fully_connected.cc.o): in function `tflite::ops::builtin::fully_connected::EvalHybridDense4Bit(TfLiteContext*, TfLiteNode*, TfLiteFullyConnectedParams*, tflite::ops::builtin::fully_connected::OpData*, TfLiteTensor const*, TfLiteTensor const*, TfLiteTensor const*, TfLiteTensor*, TfLiteTensor*, TfLiteTensor*, TfLiteTensor*, TfLiteTensor*)':
fully_connected.cc:(.text+0x3d02): undefined reference to `tflite::optimized_4bit::ReferenceBatchQuantizeFloats4Bit(float const*, int, int, signed char*, float*, int, int, int*)'
/usr/bin/ld: fully_connected.cc:(.text+0x3d50): undefined reference to `tflite::optimized_4bit::ReferenceAssignBiasAndComputeOffsets(int const*, float const*, float const*, float const*, float*, int, int)'
/usr/bin/ld: fully_connected.cc:(.text+0x3db9): undefined reference to `void tflite::optimized_4bit::ReferenceRunKernel<4, 1, 32>(unsigned char const*, signed char const*, int*, int, int, int, int, int, int)'
/usr/bin/ld: fully_connected.cc:(.text+0x3ded): undefined reference to `void tflite::optimized_4bit::ReferenceUnpack<4, 1>(float*, int const*, int, int, float const*, float const*, int, int)'
/usr/bin/ld: fully_connected.cc:(.text+0x3ff6): undefined reference to `tflite::optimized_4bit::ReferencePrepack(unsigned char*, signed char const*, int, int, int, int, int, int)'
collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/minimal.dir/build.make:186: minimal] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1372: CMakeFiles/minimal.dir/all] Error 2
gmake: *** [Makefile:136: all] Error 2
```
Repository: ollama
Issue: Support converting Starcoder2ForCausalLM from Safetensors
Labels: feature request

### What is the issue?

Failed to create starcoder2 model from Modelfile:

Error: Models based on 'Starcoder2ForCausalLM' are not yet supported



### OS

_No response_

### GPU

_No response_

### CPU

_No response_

### Ollama version

_No response_
Repository: godot
Issue:  platform differences in rendering openXRCompositionLayers with Hole Punch feature
Labels: bug,topic:rendering,confirmed,topic:xr

### Tested versions

- reproductible in 4.3.beta2
- godot openXR vendors 3.0.0

### System information

Godot v4.3.beta2 - Windows 10.0.19045 - GLES3 (Compatibility) - NVIDIA GeForce RTX 2080 SUPER (NVIDIA; 31.0.15.3640) - AMD Ryzen 9 3900X 12-Core Processor (24 Threads)

### Issue description

Testing OpenXRCompositionLayers I found some differences in rendering on diferent platforms for CompositionLayerEquirectangular and CompositionLayerQuad when using the Hole Puch feature.

SteamVR is not able to render the Hole Punch but Quest2 is able to do it. 

There is a demo project where we discuss the bug. As @BastiaanOlij pointed in the demo project comment, seems to be a problem on the XR runtime.

https://github.com/godotengine/godot-demo-projects/pull/1080#issuecomment-2198520700



### Steps to reproduce

I Attach a modified version of Bastiaan demo. Add android vendors and compare SteamVR and Quest2 export results.

Please see this comment where I explain how to reproduce it and see some images

https://github.com/godotengine/godot-demo-projects/pull/1080#issuecomment-2198520700

### Minimal reproduction project (MRP)

[openxr-composition-layers.zip](https://github.com/user-attachments/files/16065803/openxr-composition-layers.zip)
Repository: next.js
Issue: <Link prefetch={false}> not work as expected
Labels: bug,Navigation

### Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/xenodochial-link-5g95h4

### To Reproduce

1. create `A` project, add component: `<Link prefeth={false} target="_selft" href="https://samedomain.com/path-b" />`
2. build and start production
3. debug in chrome with: `window.addEventListener("beforeunload", function() { debugger; }, false)`
4. click link
5. switch to Chrome`network` tab, you can see a incorrect prefetch before page refresh
6. if the href is come from `B` project, the tree data is also incorrect. 

### Current vs. Expected behavior

should disable prefetch. which called `navigateReducer -> getOrCreatePrefetchCacheEntry -> createLazyPrefetchEntry -> fetchServerResponse`

### Provide environment information

```bash
"next": "^14.2.4"
```


### Which area(s) are affected? (Select all that apply)

Navigation

### Which stage(s) are affected? (Select all that apply)

next start (local), Vercel (Deployed), Other (Deployed)

### Additional context

_No response_
Repository: transformers
Issue: Fix 'Can't infer missing attention mask on `mps` device'
Labels: Feature request

### Feature request

I was trying out [local-gemma](https://github.com/huggingface/local-gemma) just now on my M1 macbook and ran into this error:
```
ValueError: Can't infer missing attention mask on `mps` device. Please provide an `attention_mask` or use a different device.
```
The proposed temporary solution of using `PYTORCH_ENABLE_MPS_FALLBACK=1` was not working. The cause of the error is this bit of code in `generation/utils.py`:
```py
def _prepare_attention_mask_for_generation(
        self,
        inputs: torch.Tensor,
        pad_token_id: Optional[torch.Tensor],
        eos_token_id: Optional[torch.Tensor],
    ) -> torch.LongTensor:
        # ...

        if inputs.device.type == "mps":
            # mps does not support torch.isin (https://github.com/pytorch/pytorch/issues/77764)
            raise ValueError(
                "Can't infer missing attention mask on `mps` device. Please provide an `attention_mask` or use a different device."
            )

        is_pad_token_in_inputs = (pad_token_id is not None) and (
            torch.isin(elements=inputs, test_elements=pad_token_id).any()
        )
        is_pad_token_not_equal_to_eos_token_id = (eos_token_id is None) or ~(
            torch.isin(elements=eos_token_id, test_elements=pad_token_id).any()
        )
```
Mainly, `torch.isin` is not supported. I don't know all the places where `_prepare_attention_mask_for_generation` is used or how it's used. But just a cursory glance at the code made me wonder if this is really necessary:
```py
torch.isin(elements=inputs, test_elements=pad_token_id).any()
torch.isin(elements=eos_token_id, test_elements=pad_token_id).any()
```

I fixed my issue by changing those to:
```py
(inputs == pad_token_id).any()  #  was: torch.isin(elements=inputs, test_elements=pad_token_id).any()
# and
eos_token_id == pad_token_id  # was: torch.isin(elements=eos_token_id, test_elements=pad_token_id).any()
```
and removing the mps conditional.

Again, I'm not sure if this will actually cover all use cases of that helper function but if it does, could we please go with the simple solution until `isin` is supported by MPS?

### Motivation

This should _just work_ on a macbook with mps without hacks like setting `PYTORCH_ENABLE_MPS_FALLBACK=1` (which didn't work anyway).

### Your contribution

If the proposed solution looks good then I can submit a PR (or someone else can, either way I just want my code to work).