sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: x/tools/txtar: Parse can panic with slice bounds out of range
Labels: NeedsFix,Tools

<!--
Please answer these questions before submitting your issue. Thanks!
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.16.4 windows/amd64
</pre>

### Does this issue reproduce with the latest release?

yes,this is because golang.org/x/tools/txtar, all version maybe reproduce.

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
set GO111MODULE=auto
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\x\AppData\Local\go-build
set GOENV=C:\Users\x\AppData\Roaming\go\env
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\xxx\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\
set GOPRIVATE=
set GOPROXY=
set GOROOT=D:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLDIR=
set GOVCS=
set GOVERSION=go1.16.4
set GCCGO=gccgo
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=1
set GOMOD=
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
set PKG_CONFIG=pkg-config

</pre></details>

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->
https://play.golang.org/p/b-471BZeL9y


### What did you expect to see?

program run ok

### What did you see instead?

panic: runtime error: slice bounds out of range [3:2]

because reason is:  strings.TrimSpace(string(data[len(marker) : len(data)-len(markerEnd)]))

len(marker)==3
len(data)-len(markerEnd)==2

maybe  this  have fix bugs match  marker  and markerEnd  shoud not duplicate！！！
Repository: godot
Issue: instance_set_transform: Condition ' Math::is_nan(v.x) ' is true
Labels: bug,topic:rendering,needs testing,topic:3d

### Godot version

3.3.2 Stable Flathub

### System information

GLES3  ||  Windows 7 NVIDIA GTS 450 / Windows 10 NVIDIA 2070 SUPER / Fedora 34 AMD Radeon R7 M340

### Issue description

Sometimes my game hangs and starts spamming` instance_set_transform: Condition ' Math::is_nan(v.x) ' is true` to the console. When that happens, the game stops rendering and outputs just a plain color to the screen only. 

1. **Windows 7 NVIDIA GTS 450** 
    Happened very often. Happened even when the game was idling. Not only the game hang, it also crashed.
2. **Windows 10 NVIDIA 2070 SUPER** 
    Happened somewhat often. Happened when the game removed and created the camera again on a scene change.
3. **Fedora 34 AMD Radeon R7 M340**
    Happened rarely, when the game removed and created the camera again on a scene change.

Additionally:
- I used [Godot 360](https://github.com/Cykyrios/Godot360) in this project.
- Bug happened more frequently when I enabled multiple threads in the project settings.
- Never happened on Windows 7 with Intel HD Graphics 5500

I strongly suspect that it's related to the camera translation code. I think it stopped occurring when I removed everything that was related to the translation in it. Also, there is code that is translating the camera on level changes that may trigger the bug. (not the code itself, but the act of translation)

**_I apologize for uploading a complete 180MB project instead of a minimal reproduction one, I can't find time to make a minimal project..._**  

Could be related to some of these: #32611, #39738, #35913, #50384

### Steps to reproduce

1. Skip the intro by pressing Z multiple times.
2. After that either just wait 10-20 minutes or...
2.1 Make the character enter the other location. (just go up and you will stumble upon a door) You may need to re-enter that location multiple times (five, ten or maybe more)

Eventually the bug will occur. If it does not occur, enable multiple threads in the project settings and try again.

### Minimal reproduction project

https://drive.google.com/file/d/1Co-h-YtVqOETfqg5HVUlPmYC-4Buqj8O/view?usp=sharing
Repository: material-ui
Issue: [RFC] Component structure visualisation
Labels: docs,discussion,RFC

## Summary 💡

I'd like to gather feedback about a possible improvement to the documentation: visualization of a component structure.
It could (conceptually, don't mind the visual design) look like this: https://codesandbox.io/s/component-structure-visualisation-d31po?file=/demo.tsx (blue chips represent static classes, purple chips - conditional ones).

In my opinion this will have the most impact where component customization is required. Unstyled components come to mind first, but core components could also make use of it. It is important to know the structure of slots when customizing a component. Having a visual representation of CSS classes and where they are applied could also help.
Repository: rust
Issue: Vec::iter not found in search in rustdoc
Labels: T-rustdoc,C-discussion,A-rustdoc-search

In rust doc search, I can't find `Vec::iter` although `iter` is available in `Vec`.

https://doc.rust-lang.org/std/index.html?search=vec%3A%3Aiter
Repository: pytorch
Issue: `channel_shuffle` output is sometimes aliased with its input
Labels: module: autograd,module: nn,triaged

This is because channel_shuffle calls contiguous underneath, which may return itself To fix:
- The alias information should be added to `native_functions.yaml` and also marked as `RETURNS_VIEWS_OF_INPUT` in `gen_inplace_or_view_type.py`, this should also be a composite op?
- Or because this only happens in the degenerate case of `groups = 1`, we can avoid issues by just doing a copy anyway.
```
import torch
import torch.nn as nn

channel_shuffle = nn.ChannelShuffle(1)
input = torch.randn(1, 4, 2, 2)
output = channel_shuffle(input)

print(output._is_view())
print(input)
output.add_(1)
print(input)
```

```
False
tensor([[[[ 0.6842,  1.1782],
          [-1.0532, -0.0832]],

         [[ 0.7707, -1.1699],
          [ 1.4507,  0.1143]],

         [[ 0.3884,  0.2808],
          [-0.8483,  1.9891]],

         [[-0.8413, -0.1796],
          [ 0.0351, -1.7527]]]])
tensor([[[[ 1.6842,  2.1782],
          [-0.0532,  0.9168]],

         [[ 1.7707, -0.1699],
          [ 2.4507,  1.1143]],

         [[ 1.3884,  1.2808],
          [ 0.1517,  2.9891]],

         [[ 0.1587,  0.8204],
          [ 1.0351, -0.7527]]]])
```

cc @ezyang @albanD @zou3519 @gqchen @pearu @nikitaved @soulitzer @Lezcano @Varal7 @mruberry @jbschlosser
Repository: storybook
Issue: Test runner: Report integration
Labels: feature request,test-runner

As a user, I want to be able to test my entire storybook with addons that provide structured data about the stories, e.g. a11y, perf, etc.

Report function will have a signature TBD but similar to:

```js
(story) => ({
  a11y: {
    passes: [...],
    warnings: [...],
    fails: [...],
    infos: [...]
  },
  performance: ...
})
```

For every story:
- Call the report function (if provided?)
- Pass the report results to a test function, by default something like:

```js
import { report } from '@storybook/addon-report';

export const reportTest = async () => {
  const results = await report();
  expect(results.failures.length).toBe(0);
}
```
Repository: storybook
Issue: Test runner: Run custom tests
Labels: feature request,addon: interactions

As a user, I want to be able to run custom tests across every story in my storybook in parallel

This should be at API parity with Storyshots:
- [ ] Custom test function
- [ ] Custom suite name
- [ ] Custom serializer
- [ ] Before/After hooks
- [ ] Only apply to a subset of stories

Strawman `.storybook/main.js`:

```js
// .storybook/main.js
export const addons = [
  {
    name: '@storybook/addon-test',
    options: {
      beforeAll: () => console.log('test!'),
      customTests: {
        rtl: {
          test: rtlTest, // custom 
          serializer: rtlSerializer, // custom serializer
        },
        axe: {
          test: axeTest,
          suite: 'A11y tests', // custom suite name
          browser: false,
        },
        visual: {
          test: visualTest,
          storyIdRegex: /^atoms-.*/,
        },
      }
    }
  },
];
```

With the following examples:

## Testing library

```js
// .storybook/reactTestingLibrary.js
import { render } from "@testing-library/react";

export const rtlSerializer = {
  print: (val, serialize, indent) => serialize(val.container.firstChild),
  test: val => val && val.hasOwnProperty("container")
};

export const rtlTest = async ({ storyFn, expect }) => {
  const result = await render(storyFn);
  expect(result).toMatchSnapshot();
};
```

## Axe

```js
import { axe, toHaveNoViolations } from 'jest-axe';

expect.extend(toHaveNoViolations);

export const axeTest = async ({ storyFn, expect }) => {
  const result = await render(storyFn);
  expect(await axe(container)).toHaveNoViolations();
};
```

## Visual

```js
export const visualTest = async ({ page, expect, context }) => {
  expect(await page.screenshot()).toMatchSnapshot(`${context.id}.png`);
}
```
Repository: pytorch
Issue: Move `tensordot` into `torch.linalg`
Labels: triaged,enhancement,module: linear algebra,module: python array api

This function is ready to be moved into linalg. We will make `torch.tensordot` an alias. The only thing that needs doing is to update the documentation in line with the rest of the docs of `torch.linalg`.

cc @jianyuh @nikitaved @pearu @mruberry @heitorschueroff @walterddr @IvanYashchuk @xwang233 @Lezcano @rgommers @pmeier @asmeurer @leofang @AnirudhDagar @asi1024 @emcastillo @kmaehashi
Repository: pytorch
Issue: Move `{svd,pca}_lowrank` into `torch.linalg`
Labels: triaged,enhancement,module: linear algebra

In order to move these functions to `torch.linalg` we will need to:

- Update the docs: When are this function preferable over a full SVD? Some estimations on the size of the input matrix and its rank would be very helpful to make them more usable. 
- Format the docs for them to be in line with the rest of `torch.linalg`
- Solve https://github.com/pytorch/pytorch/issues/56891

cc @jianyuh @nikitaved @pearu @mruberry @heitorschueroff @walterddr @IvanYashchuk @xwang233 @Lezcano
Repository: go
Issue: cmd/compile: large slice literals allocated in stack, causing very big frame
Labels: NeedsFix,compiler/runtime

<!--
Please answer these questions before submitting your issue. Thanks!
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.16.6 linux/amd64
go version go1.17rc1 linux/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes

### What did you do?

Moved from https://github.com/golang/go/issues/27447#issuecomment-869286163

```Go
package main

const N = 100 * 1024 * 1024

var m = make(map[byte][N]byte, 1)
func foo() {
	// [N]byte{} is unnecessarily allocated on stack, then copied to heap.
	m[0] = [N]byte{}
}

var i interface{}
func bar() {
	// [N]byte{} is unnecessarily allocated on stack, then copied to heap.
	i = [N]byte{}
}

// parameter a is allocated on stack, argument is copied to it.
func pen(a [N]byte) { // 
	type _ int // avoid being inlined
}

// argument is unnecessarily allocated on stack, then copied to heap.
func cup(v ...interface{}) {
	type _ int // avoid being inlined
}

func qin(m map[byte][N]byte) {
	type _ int // avoid being inlined
	// [N]byte{} is unnecessarily allocated on stack, then copied to heap.
	m[1] = [N]byte{}
}

func main() {
	run := func(f func(), c chan struct{}) {
		defer close(c)
		var x int
		println(&x) // <address 1>
		f()
		println(&x) // <address 2>
	}
	{
		c := make(chan struct{})
		go run(foo, c)
		<-c
	}
	{
		c := make(chan struct{})
		go run(bar, c)
		<-c
	}
	{
		c := make(chan struct{})
		go run(func() {cup([N]byte{})}, c)
		<-c
	}
	{
		c := make(chan struct{})
		go run(func() {pen([N]byte{})}, c)
		<-c
	}
	{
		c := make(chan struct{})
		go run(func() {qin(map[byte][N]byte{})}, c)
		<-c
	}
}
```

```Go
package main

import t "testing"

const M = 1024 * 1024 * 100

var n int = M - 1
var b byte

func f() {
	type _ int
	var bs = []byte{M+M: 0} // elements are allocated on stack
	b = bs[n]
}

func main() {
	x := t.AllocsPerRun(2, f)
	println(int(x)) // 0
}
```

### What did you expect to see?

It is better to allocate them on heap.

### What did you see instead?

They are allocated on stack.
Repository: pytorch
Issue: Move `lobpcg` into `torch.linalg`
Labels: triaged,enhancement,module: linear algebra

In order to move `lobpcg` into `torch.linalg` we should:

- Update the docs: When is this function preferable over `eigvals` or  `eigvalsh`. Some estimations on the size of the input matrix and its rank would be very helpful to make them more usable (needs benchmarks).
- Format the docs for them to be in line with the rest of torch.linalg
- Implement the `backwards` for non-symmetric matrices (would fix https://github.com/pytorch/pytorch/issues/38948)
- Address the performance concerns from https://github.com/pytorch/pytorch/issues/58828
- Review the API and perhaps split it into two functions, one with a simpler API and a simpler name and a full one (needs some proposals for how to do this).

cc @jianyuh @nikitaved @pearu @mruberry @heitorschueroff @walterddr @IvanYashchuk @xwang233 @Lezcano
Repository: pytorch
Issue: Allow creation of pseudo devices for testing purposes
Labels: module: internals,good first issue,triaged

## 🚀 Feature
Add a pseudo device _cpu_testing_ for testing purposes.

## Motivation
For machines with only a CPU there is currently no straight-forward way to test if `torch.device` is set properly for all tensors since `cpu` is the default. Having a dummy device, e.g., named `cpu_testing` which internally falls back to the default device but throws if two tensors with different devices are combined would allow the creation of unit tests.

## Pitch
It happens that some machines purely used for CI don't have any fancy devices other than CPU. Since CPU is the default device errors frequently occur in production where the model missed to set tensors to, e.g., GPU and this case cannot be covered in a unit test. Creating a pseudo device which also works for machines with only CPUs could help to change this defect.


cc @ezyang @bhosmer @smessmer @ljk53 @bdhirsh
Repository: PowerToys
Issue: Exclude specific windows of an application (FancyZones)
Labels: Idea-Enhancement,Product-FancyZones

### Description of the new feature / enhancement

it should be possible to set a specific window of an application on the exclution list of FancyZones

### Scenario when this would be used?

Example: While i'm working with MS Excel i open the search dialog. Because it covers some content of the table i want to move the search dialog without it snapping to a zone. 

### Supporting information
![image](https://user-images.githubusercontent.com/87436903/125650758-a0104725-cb91-4eef-88d4-7d3934782325.png)

_No response_
Repository: pytorch
Issue: Move `torch.cholesky_solve` into `torch.linalg`.
Labels: triaged,enhancement,module: linear algebra

This function is ready to be moved. It just needs

- A review of its docs in and args to go in line with `torch.linalg`.
- Make `torch.cholesky_solve` an alias.

The only point left to discuss is: do we want to name it `torch.linalg.cho_solve` in line with [scipy](https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.cho_solve.html) or do we want to maintain the `cholesky_solve` name? In my opinion our name is better, but perhaps it's better to change it for compatibility purposes?

cc @jianyuh @nikitaved @pearu @mruberry @heitorschueroff @walterddr @IvanYashchuk @xwang233 @Lezcano
Repository: node
Issue: REPL is evaluating new lines before finishing execution of previous ones
Labels: repl

### Version

16.4.2

### Platform

Archlinux x86_64

### Subsystem

_No response_

### What steps will reproduce the bug?

run with: `node --experimental-repl-await file.mjs`

```javascript
import { PassThrough } from 'stream';
import { start } from 'repl';

async function main() {
  const { input, output } = start({
    input: new PassThrough(),
    output: new PassThrough(),
    useGlobal: false,
  });

  const script = `const x = await new Promise((r) => setTimeout(() => r(1), 500));\nx;`;

  input.write(script);
  input.end();
  await new Promise((r) => setTimeout(r, 1000));
  output.end();

  let res = '';
  for await (const chunk of output) {
    res += chunk;
  }

  console.log(res);
}

main();
```

### How often does it reproduce? Is there a required condition?

100%

### What is the expected behavior?

New lines should be queued and processed only after previous lines have finished.

### What do you see instead?

New lines are executed before previous lines have finished

### Additional information

Debug output:
```sh
$ NODE_DEBUG='repl' node --experimental-repl-await file.mjs
REPL 14900: line "const x = await new Promise((r) => setTimeout(() => r(1), 500));"
REPL 14900: eval "const x = await new Promise((r) => setTimeout(() => r(1), 500));\n"
REPL 14900: line "x;"
REPL 14900: eval "x;\n"
REPL 14900: not recoverable, send to domain
REPL 14900: domain error
REPL 14900: finish null undefined
> Uncaught ReferenceError: x is not defined
> undefined
>
```

Sync code is not affected, but I would consider that a side effect of the sync code blocking the event loop preventing new lines being processed rather than a proper `pause`.

There's: https://github.com/nodejs/node/commit/de848ac1e0483327a2ce8716c3f8567eaeacb660 that used another pause logic, but got reverted due to broking multiline repl.

This issue shouldn't be a blocker for https://github.com/nodejs/node/pull/34733, as `pause` logic should be correct without depending on the event loop being blocked.
Repository: pytorch
Issue: Return `Future` instead of `Work` in `notify_join_context()`
Labels: oncall: distributed,triaged

Introduced in #61555, `_Join.notify_join_context()` returns an async work handle (of type `Work`). Since the work handle is being retired, this method should ideally return a `Future` instead, e.g. via `Work.get_future()`. 

In addition to changing [`notify_join_context()`](https://github.com/pytorch/pytorch/blob/57feb35474e90d4b62bd0273c61b7d457c9120fd/torch/distributed/algorithms/join.py#L276), this requires changing [`Reducer::set_forward_pass_work_handle()`](https://github.com/pytorch/pytorch/blob/be038d89898d0d2111b8acedefd08ceed62664cb/torch/lib/c10d/reducer.cpp), which currently expects a `c10::intrusive_ptr<c10d::ProcessGroup::Work> forwardPassWorkHandle` rather than a future. (The usage is [here](https://github.com/pytorch/pytorch/blob/57feb35474e90d4b62bd0273c61b7d457c9120fd/torch/nn/parallel/distributed.py#L880) in `DistributedDataParallel`.)

cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @agolynski @SciPioneer @H-Huang @mrzzd @cbalioglu @gcramer23
Repository: pytorch
Issue: `super().__init__()` usage for `_Joinable`
Labels: oncall: distributed,triaged

#61555 introduces the `_Joinable` abstract base class. Classes to be compatible with the generic join context manager `_Join` should inherit from `_Joinable`. However, because `torch.nn.Module` does not call `super(Module, self).__init__()`, `DistributedDataParallel.__init__()` must explicitly [call the `_Joinable` constructor via `_Joinable.__init__()`](https://github.com/pytorch/pytorch/blob/57feb35474e90d4b62bd0273c61b7d457c9120fd/torch/nn/parallel/distributed.py#L497). Similarly, because `torch.optim.Optimizer` does not call `super(Optimizer, self).__init__()`, `ZeroRedundancyOptimizer.__init__()` must explicitly [call the `_Joinable` constructor](https://github.com/pytorch/pytorch/blob/57feb35474e90d4b62bd0273c61b7d457c9120fd/torch/distributed/optim/zero_redundancy_optimizer.py#L203). 

If the `Module` and `Optimizer` constructors are modified to include the `super().__init__()` calls, then `DistributeDataParallel` and `ZeroRedundancyOptimizer` can remove the explicit call to the `_Joinable` constructor and instead rely on the method resolution order.

cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @osalpekar @jiayisuse @agolynski @SciPioneer @H-Huang @mrzzd @cbalioglu @gcramer23
Repository: pytorch
Issue: Support adding new keyword-only parameters without breaking FC
Labels: module: internals,triaged,module: codegen,needs design

TorchScript was recently updated to allow new keyword-only parameters to be added to existing operators without breaking forward compatibility. However, the following limitation applies:

> This change would only work when the new argument is added AFTER the existing ones, this is already checked and enforced by PyTorch’s backward compatibility test.

Currently, codegen requires that the output tensors are the last parameters in `native_functions.yaml`. See the following line of code for this assertion.
https://github.com/pytorch/pytorch/blob/58adaaba60441c1ed59f35389598aabf91a772dd/tools/codegen/model.py#L1284

This means that we cannot **append** new keyword-only parameters to out variants of existing operators which is required to keep FC. We should update codegen to allow keyword-only parameters to be added after out parameters.

cc @ezyang @gchanan @zou3519 @bdhirsh @jbschlosser @anjali411 @bhosmer @smessmer @ljk53 @mruberry
Repository: pytorch
Issue: Default Collate doesn't work for subtypes of ndarray
Labels: module: dataloader,triaged

https://github.com/pytorch/pytorch/blob/343cb276b0b64e5862895efb4eb5c0d384c8ca09/torch/utils/data/_utils/collate.py#L21

I'm not exactly sure why this design decision was made, but it breaks subtyping numpy arrays. For example

```python
class SubNpArray(np.ndarray):
    pass

arr = np.zeros(10).view(SubNpArray)
isinstance(arr, np.ndarray) # True
type(arr).__module__ == 'numpy'  # False
```


cc @SsnL @VitalyFedyunin @ejguan