sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: three.js
Issue: GLTFLoader: Don't duplicate vertex buffers when loading triangle fans and strips
Labels: Loaders

### Description

For some GLTF files like the one in [this discussion](https://discourse.threejs.org/t/excessive-memory-usage-for-gltf-file/62807), there are a large number of primitives which share vertex data.

The GLTF loader uses `toTrianglesDrawMode()` to convert triangle fans and triangle strips into regular triangles. The issue is that it clones the geometry, including the entire array buffer:

https://github.com/mrdoob/three.js/blob/e65206d16e59dc9b27fe267999ec5aea19a8991a/examples/jsm/utils/BufferGeometryUtils.js#L846-L852

This means that for inefficient files like `oval.gltf` (see link above), it creates nearly 10K copies of the vertex array buffer. The GLTF file has just 1.3 MB of vertex data, but the browser uses about 9 GB just to load the GLTF.

### Solution

I noticed that for primitives that use regular triangles, the array buffers are not duplicated, but are shared among all the geometries that use the same buffer in the GLTF file. As a proof of concept, I modified `toTriangleDrawMode` in this way:

```js
    // build final geometry

    const newGeometry = geometry.clone()
    newGeometry.setIndex(newIndices)
    newGeometry.clearGroups()

    // Replace each attribute's array with the original array, and let GC clean up the new arrays that were just created by .clone()
    for (const key in newGeometry.attributes) {
      newGeometry.attributes[key].array = geometry.attributes[key].array // use original array
    }

    return newGeometry
```

After cloning the geometry, it resets the new array back to the original, and allows GC to clean up the cloned arrays. Obviously, a better solution would be to avoid cloning the array buffer in the first place. 

This does not stop Three.js from uploading the array buffers to the GPU separately, so it's still going to waste the same of memory on the GPU, but at least the RAM usage will be much lower. I believe this issue discusses this problem in more detail: https://github.com/mrdoob/three.js/issues/17089

### Alternatives

Naturally, I've tried optimizing the GLTF file using both `gltfpack` and `gltf-transform`. And although both of those do work, they end up taking just as much memory to do the optimization. Reducing the number of primitives (and thus, draw calls) would definitely be the ideal solution, but I cannot control the generation of the GLTF files, since they are uploaded by users on a website.

### Additional context

_No response_
Repository: godot
Issue: Linux X11 OpenGL/Vulkan - After changing window size, window content doesn't immediately refresh to match new size
Labels: bug,platform:linuxbsd,topic:gui

### Tested versions

- Reproducible in: v4.2.1.stable.official [b09f793f5]

### System information

Godot v4.2.1.stable - Ubuntu 22.04.3 LTS 22.04 - X11 - Vulkan (Mobile) - dedicated NVIDIA GeForce GTX 860M (nvidia; 535.154.05) - Intel(R) Core(TM) i7-4710HQ CPU @ 2.50GHz (8 Threads)

### Issue description

I was sure the issue had been reported, but apparently it was only casually mentioned on pages like Q&A saying how to change window size by command line. So I open a bug now.

I have an AppManager script that changes the window size when user presses a certain key (as fallback until I implement a proper menu, or for quick testing).

I noticed that changing window size via code `_unhandled_input` or `_physics_process` can cause the window to change size, but the content gets stuck (rest is filled with black if size increased, or game content is cut is size decreased).

It seems to work fine when window is resized on _ready (fortunately, as I need this for custom initial scale on start).

Using `call_deferred` on `DisplayServer.window_set_size` doesn't help.

For instance, if I start with this window:

![image](https://github.com/godotengine/godot/assets/1067772/1e6a3dd5-4618-4c68-833a-9ecffcaa4f4c)

and press the window size change button, I could get this:

![image](https://github.com/godotengine/godot/assets/1067772/495289b9-160a-40de-907c-fbe57e7d601d)

On second try, it works. Sometimes, it auto-refreshes after a second.

It seems to only happen on my Linux, which uses X11, and both with OpenGL in Compatiblity and Vulkan in Forward+ (although my GPU is not 100% compatible with it - but the issue seems to be a window thing more than actual content rendering thing).

### Steps to reproduce

1. Open MWE in demo.tscn
2. Run game
3. Press K to increase window size, J to decrease (you can change this in Input Map). Repeat and observe.
4. You can also test toggle fullscreen (F) but in general it works
5. You can press Q to quit and relaunch the game for a fresh test
6. Variant: edit WindowSizeManager.gd, locate Method A & B code, comment method A and uncomment method B to `call_deferred` window resize => still same issue

Note: after reaching full screen, window size tends to get stuck. But that's another issue.

### Minimal reproduction project (MRP)

[v4.2.1 - Linux X11 window resize doesnt immediately refresh.zip](https://github.com/godotengine/godot/files/14621467/v4.2.1.-.Linux.X11.window.resize.doesnt.immediately.refresh.zip)
Repository: material-ui
Issue: [joy-ui] Allow extending the color inversion feature
Labels: waiting for 👍,package: joy-ui,customization: theme

### Summary

The color inversion feature is incredibly neat. Unfortunately it's not clear how to override it so that I can change how font colors change during an inversion, for example. 

I have overriden the theme's neutral parameters (to make them darker / lighter depending on whether light/dark is enabled).

Unfortunately, the typography's colors remain default (I believe because of how the default theme works). In other words, the colors of the text is always white. 

I was hoping to be able to invert black / white for one section of the page (using `<Sheet />`), but it seems impossible to do with this feature currently. Please let me know if I am failing to understand something.



### Examples

See above.

### Motivation

Invert black & white completely

**Search keywords**: color inversion
Repository: ollama
Issue: Update context window management to avoid context shifts
Labels: feature request

### What are you trying to do?

Today, upon reaching the context window limit, a "context shift" occurs, effectively halving the number of tokens in the context window to make room for new generations. However, we should avoid this – OpenAI and other tools instead have token limits that, when reached, stop generation and let the user know.

### How should we solve this?

A few ideas:

* Make sure at least x% of the prompt is available for generation beyond the prompt
* Add a `reason` or similar key to `/api/generate` and `/api/chat` so it's obvious when the token limit is hit


### What is the impact of not solving this?

Possible run-ons and poorer responses from context shifting

### Anything else?

_No response_
Repository: PowerToys
Issue: QOI decoder fails on images with a width non-divisible by 4
Labels: Issue-Bug,Product-File Explorer,Needs-Triage,Product-Peek

### Microsoft PowerToys version

0.79.0

### Installation method

GitHub

### Running as admin

Yes

### Area(s) with issue?

File Explorer: Preview Pane, File Explorer: Thumbnail preview, Peek

### Steps to reproduce

1. Use any of the toys that decode a QOI image (such as Peek or the Explorer thumbnail provider) on any image that has a pixel width that is not divisible by 4 (**the image must be fully opaque**). 
2. The image is either not decoded correctly, or crashes the application (as explained in further detail below):
![image](https://github.com/microsoft/PowerToys/assets/34184902/b1ca6256-3cb1-4caf-87aa-f8665d5e45cb)


### ✔️ Expected Behavior

QOI decoder should work as expected on all images - the width being divisible by 4 is not a requirement of the specification

### ❌ Actual Behavior

As long as the image has no transparency, it is slanted (when `width % 4 == 3`), is slanted and has heavily distorted colours (when `width % 4 == 2`), or crashes the application (when `width % 4 == 1`)
- Crash example: https://1drv.ms/u/s!AuDzmORdx3YJjbwJcFgEIYCYMBJ0nQ?e=zethfV
- Skew + colour distort example: https://1drv.ms/u/s!AuDzmORdx3YJjbwKHHLqw1HZVMcIQQ?e=M1cYTU

### Other Software

_No response_
Repository: godot
Issue: Single word characters cannot be selected with double click in Editor
Labels: bug,topic:gui

### Tested versions

v4.3.dev3.official [36e943b6b]

### System information

Linux Kubuntu 23.04 KDE Plasma Version: 5.27.4 KDE Frameworks Version: 5.104.0 Qt Version: 5.15.8

### Issue description

**Double clicking** does not select  on _single word characters_ such as alpha or numeric, in the Editor, unless the character is at the end and the cursor is placed after it. (I know, who uses single character variable names), but just thought I would report it since other editors I tested behave as expected.

```gdscript
        # a not selectable but 2 is if cursor at end of line.
	var a = 2

        # b and a not selectable
	var b= a*2

        # c not selectable
	var c =2

        # d not selectable
	d = 7

        # cc is selectable
	var cc= 2
```

### Steps to reproduce

see above

### Minimal reproduction project (MRP)

see above
Repository: TypeScript
Issue: TS doesn't narrow generic parameter T to null, despite an explicit comparison
Labels: Possible Improvement

### 🔎 Search Terms

T to null

### 🕗 Version & Regression Information

- This is a type narrowing issue
- This is the behavior in every version I tried

### ⏯ Playground Link

https://www.typescriptlang.org/play?ts=5.5.0-pr-57465-110#code/GYVwdgxgLglg9mABDAzgORAG0wHgCoB8AFAG4CGmIApgFyJ4CUiA3gFAD07i3P3AegH5W3GMESkK1RAF5ZiMFkxM2vcpSrdO9ADSIUACzhYAJogBGGhdmGIAvqxsAnKlBCOkaqbOnzFAblZ7IA

### 💻 Code

```ts
function isNull<T>(value: T) {
  if (value === null) {
    value  // T, should be null
  }

  return value === null;
}

```

### 🙁 Actual behavior

value is T inside the if block of value === null (explicit comparison)

### 🙂 Expected behavior

value should be of type null inside the if block of value === null

### Additional information about the issue

_No response_
Repository: godot
Issue: My game causes an error upon exiting when it does not have an audio device connected
Labels: bug,topic:audio

### Tested versions

4.3 dev 5

### System information

Godot v4.3.dev5.mono - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3070 (NVIDIA; 31.0.15.5176) - Intel(R) Core(TM) i7-9700KF CPU @ 3.60GHz (8 Threads)

### Issue description

My game causes an error upon exiting when it does not have an audio device connected.

Turning on my speaker works normally if there is an audio device connected.

![QQ截图20240316112229](https://github.com/godotengine/godot/assets/20112581/b1bbe450-00d0-4bea-b4e7-b74ed6088c43)




### Steps to reproduce

1. start
2. exit
3. error

### Minimal reproduction project (MRP)

N/A
Repository: ui
Issue: [Bug]:  Command/Combobox TypeError and Unclickable/Disabled items, cmdk breaking change 
Labels: bug

### Describe the bug

Why I faced Disabled items with no reason ?

### Affected component/components

Command, combobox, CommandItem

### How to reproduce

Right click on The component <CommanItem>, chose:
Go to Definition F12, then:
Go to the Component tailwind styling, then: 
Remove the following classes from the className 👍🏻 : 
"data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
or change the [disabled] data to [true]
🥇 Congrats ! You solved your issue.

### Codesandbox/StackBlitz link

please add a reproduction

### Logs

```bash
nothing
```


### System Info

```bash
nothing
```


### Before submitting

- [X] I've made research efforts and searched the documentation
- [X] I've searched for existing issues
Repository: godot
Issue: Editor Crash when import this image
Labels: bug,needs testing,topic:import,crash

### Tested versions

v4.1.stable.mono.official [970459615]
v4.2.1.stable.mono.official [b09f793f5]

### System information

Godot v4.2.1.stable.mono - macOS 14.3.1 - Vulkan (Mobile) - integrated Apple M2 Max - Apple M2 Max (12 Threads)

### Issue description
Image cause asset import crash. See this test project `res://Asset/Shadow Of Storms 159x53.png`.

### Steps to reproduce

### Minimal reproduction project (MRP)

[AssetTest.zip](https://github.com/godotengine/godot/files/14622421/AssetTest.zip)
Repository: flutter
Issue: Alert user of invalid application name due to a conflicting default package name
Labels: c: new feature,tool,c: proposal,team-tool

### Use case

I attempted to create an app called `matcher`, but since the `flutter_test` package has a dependency called matcher, I receive this error: 

`Because matcher depends on flutter_test from sdk which depends on matcher 0.12.16+1, matcher 0.12.16+1 is required.
So, because matcher is 1.0.0+1, version solving failed.`

I think it'd be a good to let the user know explicitly if the name they gave for their application has a conflict. While it only took me a few minutes to figure out, I would expect it to be much more confusing to a less experienced/beginner Flutter developer.

### Proposal

I wasn't sure how the Flutter team would want to proceed with this - if the better fix is trying to make apps work when named any valid Flutter package name or if it'd be better to just explicitly restrict package names. I decided on the latter so I opened this feature request.

I think the best solution would be to include a list of conflicting app names and inform the user that a name is conflicting with a default package name. For example:

```
> flutter create matcher --template app
"matcher" is a default dependency in this template. If you proceed, you will need to manually configure the pubspec.yaml files in order to successfully compile your app. Proceed (Y/N)?
```
Repository: rust
Issue: Cannot chain inherent associated types
Labels: T-compiler,C-bug,F-inherent_associated_types,requires-incomplete-features

<!--
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 tried this code:

```rust
#![feature(inherent_associated_types)]
struct A<const N: usize> {}

struct B<const N: usize> {}

impl<const N: usize> B<N> {
    type C_ = C<N>;
}

struct C<const N: usize> {}

impl<const N: usize> A<N> {
    type B_ = B<N>;

    fn fun() -> Self::B_::C_ {
        todo!()
    }
}

fn main() {}

```

rustc says:
```
error[E0223]: ambiguous associated type
  --> src/lib.rs:15:17
   |
15 |     fn fun() -> Self::B_::C_ {
   |                 ^^^^^^^^^^^^
   |
help: if there were a trait named `Example` with associated type `C_` implemented for `A<N>::B_`, you could use the fully-qualified path
   |
15 |     fn fun() -> <A<N>::B_ as Example>::C_ {
   |                 ~~~~~~~~~~~~~~~~~~~~~~~~~
```

### 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.78.0-nightly (4a0cc881d 2024-03-11)
binary: rustc
commit-hash: 4a0cc881dcc4d800f10672747f61a94377ff6662
commit-date: 2024-03-11
host: x86_64-unknown-linux-gnu
release: 1.78.0-nightly
LLVM version: 18.1.0
```
Repository: godot
Issue: When importing image as Font Data resource, out of bounds row/column values cause crash upon clicking reimport
Labels: bug,topic:editor,needs testing,topic:import,crash

### Tested versions

v4.2.1.stable.official [b09f793f5]

### System information

Godot v4.2.1.stable - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 3080 (NVIDIA; 31.0.15.3770) - 12th Gen Intel(R) Core(TM) i9-12900 (24 Threads)

### Issue description

If you set the rows/columns to 0 when importing a font data image, it crashes the editor.  The field should be sanitized to only accept values >=1

### Steps to reproduce

![image](https://github.com/godotengine/godot/assets/89282845/1697dacd-a6fa-47c1-9879-80e8f8211a6c)
click 'reimport'

### Minimal reproduction project (MRP)

N/A
Repository: PowerToys
Issue: PowerRename Regex skipping file that should be matched
Labels: Issue-Bug,Product-PowerRename,Status-Reproducible

### Microsoft PowerToys version

0.79.0

### Installation method

PowerToys auto-update

### Running as admin

No

### Area(s) with issue?

PowerRename

### Steps to reproduce

See screenshots. I'm renaming a bunch of images to change and fix their sequence number. Some of the original files end with " (2)". You can see I have a wildcard in the regex to optionally match that. This works, except for the first file that doesn't have the " (2)". I tried the same regex on https://regex101.com/ with the EMCAScript flavor and it should match.
![image](https://github.com/microsoft/PowerToys/assets/30078018/467a7e96-1646-4b3d-96ca-e21515b6a1b2)
I tried manually renaming that file to remove the " (2)". After then, the next file became the issue - i.e. the file that was NOW the first one without the " (2)".
![image](https://github.com/microsoft/PowerToys/assets/30078018/121e5f5c-1115-471c-8a70-9830815d606f)


### ✔️ Expected Behavior

All files matching the regex should be matched.

### ❌ Actual Behavior

See screenshots. The first file matching a different 'branch' of the regex is not matched.

### Other Software

_No response_
Repository: next.js
Issue: Build output doesn't warn when page is opted into dynamic rendering
Labels: bug,Pages Router

### Link to the code that reproduces this issue

https://github.com/rijk/next-debug-fetch-cache

### To Reproduce

1. Update `CACHE_BUSTER` key in `/app/constants.ts`
2. Deploy to Vercel
3. Click One, Three or Four in the nav bar
4. Observe 5s delay

### Current vs. Expected behavior

**Current behavior** 
Navigating to e.g. One for the first time after building takes ~5s.

**Expected behavior** 
Navigating to e.g. One for the first time after building takes ms because the `fetch` is served from the build's Data Cache.

**Background**
When the tree contains a component that uses e.g. `cookies()`, [the route is opted into dynamic rendering at request time](https://nextjs.org/docs/app/building-your-application/rendering/server-components#dynamic-functions). To simulate this, I added a `<Cart>` component that accesses the cookies. Without this component, the whole app is fully static.

Every page contains a fetch that artificially delays rendering, but can and should be handled by the [Data Cache](https://nextjs.org/docs/app/building-your-application/caching#data-cache). However, when deployed on Vercel I found that it is not using the values cached at build time, but rather does a new fetch the first time you access the page. Afterwards, the fetches are served from the cache (no 5s delay after refreshing).

**Sidenote** 
I'd also expect the routes with data cache to perform more closely to full route cache. Especially least when they can be prefetched. Navigating to Home is instant, navigating to One or Two takes about 200ms and shows the loading fallback.

### Provide environment information

```bash
Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 23.4.0: Wed Feb 21 21:51:37 PST 2024; root:xnu-10063.101.15~2/RELEASE_ARM64_T8112
Binaries:
  Node: 20.11.0
  npm: 10.2.4
  Yarn: 1.22.19
  pnpm: 8.15.4
Relevant Packages:
  next: 14.1.3
  eslint-config-next: N/A
  react: 18.2.0
  react-dom: 18.2.0
  typescript: N/A
Next.js Config:
  output: N/A
```


### Which area(s) are affected? (Select all that apply)

App Router, Data fetching (gS(S)P, getInitialProps)

### Which stage(s) are affected? (Select all that apply)

Vercel (Deployed)

### Additional context

This happens on both the normal and edge runtime.
Repository: godot
Issue: In Tilemap TileSetScenesCollectionSource, change source_id,but the UI doesn't display right.
Labels: bug,topic:editor

### Tested versions

v4.2.1.stable.official [b09f793f5]

### System information

Godot v4.2.1.stable - Windows 10.0.22631 - Vulkan (Mobile) - dedicated NVIDIA GeForce RTX 3060 Laptop GPU (NVIDIA; 31.0.15.5161) - AMD Ryzen 7 5800H with Radeon Graphics (16 Threads)

### Issue description

The right UI display:
![image](https://github.com/godotengine/godot/assets/36144612/f22d928e-6966-4ee5-8cea-5dc06b673e7a)

![image](https://github.com/godotengine/godot/assets/36144612/6e377168-79f8-4bc8-b70f-a1ddd84056ab)

The BUG:
i want to change the source_id to make it sorted(5,6,7....) to use in the code
```gdscript
set_cell(4,map_pos,7,Vector2i(0,0),1) 
```
but the UI cant not change? it remaind 8
Good, It can still run correctly ,so i guess it has changed but UI not work rightly.

I create a TileSetScenesCollectionSource (7),and delete it(7) then create a new TileSetScenesCollectionSource.(display 8)

![image](https://github.com/godotengine/godot/assets/36144612/42781e6f-3d26-4810-863a-ac44fe672882)

![image](https://github.com/godotengine/godot/assets/36144612/f913bead-2aed-4dfd-bad5-5f65d4e000c0)

![image](https://github.com/godotengine/godot/assets/36144612/ba8fe855-d250-4acc-ae82-0c8a8262d802)


By the way, i add  inherit scene to TileSetScenesCollectionSource, but it repo
"Invalid PackedScene for TileSetScenesCollectionSource: res://plants/maitscn. Could not get the type of the root node.x"
someone repo it ,and has fixed. After Reload this Project ,it can work correctly.

### Steps to reproduce

null

### Minimal reproduction project (MRP)

null
Repository: PowerToys
Issue: Wrong Chinese translation for Mouse Without Borders
Labels: Issue-Bug,Area-Localization,Loc-Sent To Team,Issue-Translation

### Microsoft PowerToys version

0.79.0

### Utility with translation issue

Mouse Without Borders

### 🌐 Language affected

Chinese

### ❌ Actual phrase(s)

![image](https://github.com/microsoft/PowerToys/assets/119716040/3a9b0283-1640-4dd4-9831-1eb9cc457a32)
![image](https://github.com/microsoft/PowerToys/assets/119716040/c7bd56e9-4ce3-46ca-94c9-7b2db510dd4c)

Mouse Without Borders → 无边框鼠标

### ✔️ Expected phrase(s)

Mouse Without Borders → 无界鼠标

### ℹ Why is the current translation wrong

The translation “无边框鼠标” means that the mouse doesn't have a frame.
“无界鼠标” is a better translation for Mouse Without Borders.
The current title is using the correct name "无界鼠标“, while it is still "无边框鼠标” for the [document](https://learn.microsoft.com/zh-cn/windows/powertoys/mouse-without-borders), description text and the activation button.
Repository: deno
Issue: Closing stdin causes `prompt()` to output a newline, in contrast to `confirm()`
Labels: bug,good first issue,runtime

Running the following command and pressing Ctrl+D to close the standard input stream reveals that the built-in `prompt()` function outputs a newline in this case:

```
$ deno eval 'prompt()'
Prompt
$
```

Surprisingly, `confirm()` does not exhibit this behavior (note the location of the second `$` prompt):

```
$ deno eval 'confirm()'
Confirm [y/N] $
```

I would argue that the latter response is more correct, by analogy with C. Consider the following POSIX.1-2008&ndash;compliant program:

```c
#define _DEFAULT_SOURCE
#include <stdio.h>
#include <stdlib.h>

int main(void) {
	fputs("Prompt ", stdout);

	char *buf = NULL;
	size_t len = 0;
	getline(&buf, &len, stdin);
	free(buf);

	return 0;
}
```

Hitting Ctrl+D elicits the `confirm()`-style behavior on my GNU/Linux system:

```
$ c99 -o getline getline.c && ./getline
Prompt $
```

I noticed this inconsistency when filing #22955: it is responsible for the extra newline in the final command-line example in that issue. I haven't traced the issue deeper than `prompt()`'s use of `op_read_line_prompt()` (in contrast to `confirm()`'s `readLineFromStdinSync()`) in `runtime/js/41_prompt.js`.

Tested on this official release build:

```
$ deno --version
deno 1.41.0 (release, x86_64-unknown-linux-gnu)
v8 12.1.285.27
typescript 5.3.3
```