sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: testing: benchmark performance misaligned for fast tests
Labels: Testing,NeedsInvestigation

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.12.1 darwin/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/ondrej.kokes/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/ondrej.kokes/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12.1/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12.1/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/mk/dqryy0_947936yjsdw8jl6v00000gp/T/go-build420651873=/tmp/go-build -gno-record-gcc-switches -fno-common"
</pre></details>

### What did you do?

I ran some fast tests, where each iteration took less than a nanosecond. This led to the results table to be misaligned.

Here's a reproducible example:

```goo
package foo

import (
	"testing"
	"time"
)

func BenchmarkFoo(b *testing.B) {
	for j := 0; j < b.N; j++ {
		time.Sleep(time.Millisecond)
	}
}

func BenchmarkBar(b *testing.B) {
	for j := 0; j < b.N; j++ {

	}
}
```


### What did you expect to see?

```
goos: darwin
goarch: amd64
BenchmarkFoo-4   	    1000	   1357941 ns/op
BenchmarkBar-4        2000000000	      0.32 ns/op
```

### What did you see instead?

```
goos: darwin
goarch: amd64
BenchmarkFoo-4   	    1000	   1357941 ns/op
BenchmarkBar-4   	2000000000	         0.32 ns/op
```

### Thoughts

I guess this has to do with performance numbers [being printed](https://github.com/golang/go/blob/master/src/testing/benchmark.go#L436) as `%8d`, so anything larger than that will get shifted.
Repository: TypeScript
Issue: Ambient imports are not removed when importing an interface from a package & emitDecoratorMetadata is enabled
Labels: Bug

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Even if you think you've found a *bug*, please read the FAQ first, especially the Common "Bugs" That Aren't Bugs section!

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ: https://github.com/Microsoft/TypeScript/wiki/FAQ

Please fill in the *entire* template below.
-->

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  3.4.0-dev.20190319

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:**
emitDecoratorMetadata emit decorator metatdata import interface package experimental decorators experimentalDecorators

**Code**
With the following enabled:

- `experimentalDecorators`
- `emitDecoratorMetadata`

This happens specifically when you import an interface (and nothing else) from a package, and try to add a decorator onto a class (I haven't checked with functions yet) that uses the interface. If you are doing the same with a file in the same compilation, then it works fine.

```ts
import { SampleInterface } from 'package';

function TestDecorator(constructor: Function) {
  console.log(constructor);
}

@TestDecorator
class Test {
  public constructor(public readonly obj: SampleInterface) {}
}

const t = new Test({
  a: 'a',
  b: 2
});
```

If you need a more concrete example, I can try and publish a small example library and try to reproduce it with that.

**Expected behavior:**
The import to `package` should be removed from the output (the same as importing from a local file).

**Actual behavior:**
The import is left in the output, and is never used.
Repository: flutter
Issue: make background execution as developer-friendly as possible
Labels: c: new feature,framework,P3,team-framework,triaged-framework

Most app these days has a need to run in the background and on certain event make calls to callback functions. Using flutter this has been a really tedious task that mostly requires hacks.

Searching around for possible solutions,  I found this article on medium.
https://medium.com/flutter-io/executing-dart-in-the-background-with-flutter-plugins-and-geofencing-2b3e40a1a124

But then it is not so user friendly and I think it only targets advanced developers.

-----------------------------------------------------------------
I have thought about possible simple solutions;

Is it possible to Provide a wrapper around runApp() that will enable whatever app it wraps run in background mode and also accepts callback functions to be called on certain  events that might be triggered.l?

Secondly, is there a way to make the class housing the parent material app (where app theme, fonts, accent colors etc are set)  to extend another class/mixin which then provides the background execution feature and also handy functions to override and set callbacks, etc.?
Repository: pytorch
Issue: Update weight initialisations to current best practices
Labels: high priority,module: bc-breaking,feature,module: nn,triaged,quansight-nack

## 🚀 Feature
Update weight initialisations to current best practices.

## Motivation
The current weight initialisations for a lot of modules (e.g. `nn.Linear`) may be ad-hoc/carried over from Torch7, and hence may not reflect what is considered to be the best practice now. At least they are now documented (https://github.com/pytorch/pytorch/pull/9038), but it would be better to pick something sensible now and document it (as opposed to e.g. what happened with `nn.Conv2d`: https://twitter.com/jeremyphoward/status/1107869607677681664).

## Pitch
Update the weight initialisations for modules to the following (using `nn.init` where applicable):

- `Linear`: ? weight, zero bias
- `Bilinear`: ? weight, zero bias
- `Embedding`: ? weight
- `EmbeddingBag`: ? weight
- `Conv{Transpose}{1,2,3}d`: ? weight, zero bias
- `RNN{Cell}`: ? weight_ih, ? weight_hh, zero bias_ih, zero bias_hh
- `LSTM{Cell}`: ? weight_ih, ? weight_hh, zero bias_ih, zero bias_hh (though perhaps +1 forget gate bias)
- `GRU{Cell}`: ? weight_ih, ? weight_hh, zero bias_ih, zero bias_hh
- `BatchNorm{1,2,3}d`: ones weight, zero bias
- `GroupNorm`: ones weight, zero bias
- `InstanceNorm{1,2,3}d`: ones weight, zero bias
- `LayerNorm`: ones weight, zero bias

The current proposal is to have new weight initialisations as default, acknowledge that this is a breaking change, but have a (global?) flag to revert to the original initialisations in order to preserve backwards compatibility if necessary.

cc @ezyang @gchanan @zou3519 @SsnL
Repository: react
Issue: eslint-plugin-react-hooks - autofix useCallback/useMemo behaviour
Labels: Type: Discussion,Component: ESLint Rules

**Do you want to request a *feature* or report a *bug*?**

Discussion for new feature

**What is the current behavior?**

useCallback/useMemo hook's do nothing when there is no second argument provided for deps. The eslint plugin reports this but does not autofix


**Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?**

16.8.4

**PR to implement:** 

https://github.com/facebook/react/pull/15146

&nbsp;

Currently, the eslint plugin does not autofix useCallback/useMemo to infer deps if there isn't a second argument provided to the hook. We can autofix it to infer deps if needed, or autofix to remove the hook altogether if there no deps needed (according to https://reactjs.org/docs/hooks-reference.html#usememo, if no second argument is provided it behaves as if the hook doesn't exist anyways).

What would be the best way to implement this autofix? In my opinion, linting shouldn't be breaking functionality on an autofix, so autofixing to remove the hook is the safest to implement. Autofixing to infer deps will change behavior in code so I was thinking of having a config option the dev needs to specify so that linting changes that is affecting behavior is explicit.
Repository: react
Issue: Effect memoization and immutable data structures
Labels: Type: Discussion

Current design of `useEffect` requires dependencies to be either primitive values or references to the same object, because shallow equality check relies on `Object.is` which is an identity check for objects.

The above means that there's no way to perform structural comparison, which is needed for immutable data structures when identity check fails.

To maintain backwards compatibility a comparator function could be provided as the third argument to `useEffect`:
```js
useEffect(fn, deps, depsComparator);
```

The goal here is to preserve an ease of use of the API with immutable data structures in order to provide an idiomatic usage of `useEffect` in ClojureScript and other environments that rely on immutability e.g. Immutable.js

cc @mhuebert @Lokeh @orestis
Repository: godot
Issue: ResourceSaver.save() discards instanciation of inherited scenes
Labels: bug,topic:core,confirmed

___

***Bugsquad note:** This issue has been confirmed several times already. No need to confirm it further.*

___

**Godot version:**
3.1.stable.official

**OS/device including version:**
Manjaro Linux

**Issue description:**
When saving a node to disk with ResourceSaver.save() and the node is an inherited scene, the instantiation in the saved scene is discarded. 
It does not happen with instantiated child nodes of the saved node, only if the saved node itself is an instanced scene.

**Steps to reproduce:**
1. Open Project in Editor.
2. Open SaveMe.tscn
3. Run the Project
- running the project will save the instanced SaveMe in Main into res://save/
4. Compare `res://SaveMe.tscn` with `res://save/SaveMe.tscn`

**Minimal reproduction project:**
[resource-saver.zip](https://github.com/godotengine/godot/files/2984977/resource-saver.zip)
Repository: godot
Issue: AnimationPlayer track values overlapping
Labels: bug,topic:editor,confirmed,usability

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:**
3.1 stable


**OS/device including version:**
Win


**Issue description:**
Track values are illegible because they overlapp each other visually, especially if the are longer or the keyframes closer together.
![callfunckey31](https://user-images.githubusercontent.com/47016402/54633989-87238780-4a81-11e9-8e8d-917962432bce.png)

Proposed solution: Hide the text of the previous value where the next keyframe starts.
Repository: godot
Issue: Add texture channel choice for all BW/Greyscale textures in Spatial Materials
Labels: enhancement,topic:rendering

**Feature proposal**
3D / Spatial Material / Material colors, maps and channels

if it isn’t a technical limitation, it would be useful to have the possibility to choose whatever channel we want for any grayscale /BW texture we use in the Spatial material. We already can for some of them (ie : Metallic /Roughness/ AO) but not for Depth or the Detail Mask.
Repository: rust
Issue: Better diagnostics for multiple borrowed fields with non-unified lifetimes
Labels: C-enhancement,A-diagnostics,A-lifetimes,T-compiler,fixed-by-NLL

[The following code](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=881a7cde8e12b2b441de99c478aa9a99)

```
struct Foo<'a> { a: &'a usize }

fn get_account_value<'l>(
    flag: bool,
    a: &'l mut Foo,
    b: &'l mut Foo,
) {
    let _ = if flag { a } else { b };
}
```

Produces the following output:

```
error[E0623]: lifetime mismatch
 --> src/main.rs:8:34
  |
5 |     a: &'l mut Foo,
  |                ---
6 |     b: &'l mut Foo,
  |                --- these two types are declared with different lifetimes...
7 | ) {
8 |     let _ = if flag { a } else { b };
  |                                  ^ ...but data from `b` flows into `a` here

error[E0623]: lifetime mismatch
 --> src/main.rs:8:34
  |
5 |     a: &'l mut Foo,
  |                --- these two types are declared with different lifetimes...
6 |     b: &'l mut Foo,
  |                ---
7 | ) {
8 |     let _ = if flag { a } else { b };
  |                                  ^ ...but data from `a` flows into `b` here

error: aborting due to 2 previous errors
```

It seems like the borrow checker could handle this case better. Particularly, the fact that `Foo` has a lifetime makes the errors more puzzling than they need to be.
Repository: rust
Issue: Tracking issue for musl host toolchain
Labels: T-compiler,O-musl,C-tracking-issue,S-tracking-impl-incomplete

TODO:
- [x] Installable host toolchain (https://github.com/rust-lang/rust/pull/58575)
  - [x] Rustup support (https://github.com/rust-lang/rustup.rs/pull/1882)
- [x] Tests passing as the host (https://github.com/rust-lang/rust/pull/60474)
- [ ] Transition musl targets to dynamically link libc by default
  - MCP approving this: https://github.com/rust-lang/compiler-team/issues/422
- [x] static-pie support https://github.com/rust-lang/rust/issues/53968 (done in https://github.com/rust-lang/rust/pull/70740)
- [x] Update to musl 1.2 https://github.com/rust-lang/rust/issues/91178

For people looking how to use as it dynamic target:
```bash
RUSTFLAGS="-C target-feature=-crt-static" cargo build
```
Repository: go
Issue: x/net/idna: context validation
Labels: NeedsInvestigation

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.11.5 linux/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env

GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"

</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.
-->


I wrote an example to convert a-label to u-label an viceversa and also perform IDNA2008 validation based on the provided a-label.

I checked the results with other IDNA tools and found that with net/idna I am not getting context errors that other libraries are reporting.

Here is the main code of the example:

```
func main() {
	p = idna.New(
		idna.BidiRule(),
		idna.MapForLookup(),
		idna.StrictDomainName(true),
		idna.Transitional(false),
		idna.ValidateForRegistration(),
		idna.ValidateLabels(true),
		idna.VerifyDNSLength(true))
	alabel := os.Args[1]

	ulabel, error := p.ToUnicode(alabel)
	if error != nil {
		fmt.Printf("Error converting string: %v\n", error)
		os.Exit(1)
	}
	fmt.Println(alabel,ulabel)

	convertedAlabel, error := p.ToASCII(ulabel)
	if error != nil {
		fmt.Printf("Error converting string: %v\n", error)
		os.Exit(1)
	}

	if convertedAlabel != alabel {
		fmt.Printf("Provide a-label doesn't match converted a-label: %v\n", convertedAlabel)
		fmt.Println(convertedAlabel)
		os.Exit(1)
	}

}
```

Here are some label examples:

```
xn--diethealth-zp5i
xn--diy-ps4bb
xn--pfs-ps4bb
```

Can you please confirm if this is missing validation of IDNA2008?

Could it be possible to include one new method/flag to get full IDNA2008 validation with the function?

### What did you expect to see?

Here are the errors reported for 2 other idna utilities:

```
 xn--diethealth-zp5i,string contains a forbidden context-o character,Codepoint U+30FB not allowed at position 5 in 'diet・health'
  xn--diy-ps4bb,string contains a forbidden context-o character,Codepoint U+30FB not allowed at position 2 in 'd・i・y'
  xn--pfs-ps4bb,string contains a forbidden context-o character,Codepoint U+30FB not allowed at position 2 in 'p・f・s'
```
### What did you see instead?

```
xn--diethealth-zp5i diet・health
xn--diy-ps4bb d・i・y
xn--pfs-ps4bb p・f・s
```
Repository: go
Issue: net/http: http.Client calls can stall when a persistent connection is slow to close
Labels: NeedsInvestigation

go1.12's http.Client supports supplying a customized RoundTripper as the transport.  A custom Dial can be supplied, e.g., to implement tunneling or proxying through nonstandard protocols, and returns objects implmenting net.Conn, which in turn includes a Close().  The native implementation of Close() on UNIX is a close(2) on the underlying socket, which is a local syscall and rarely blocks, especially in HTTP.  However, if the supplied Dial returns a net.Conn with a longer shutdown (e.g. because it's tunneling over another protocol that requires doing a round trip on the underlying protocol to gracefully terminate), it can block for longer - potentially as long as the network RTT to a distant server plus that server's internal processing time.

The http implementation tries to keep persistent connections around, and when a new request is initiated to a "key" (scheme+protocol+host+port), it has an LRU cache of idle connections to choose from in getIdleConn() (https://golang.org/src/net/http/transport.go#L829).  Before choosing one, it calls isBroken() on the corresponding http.persistConn (https://golang.org/src/net/http/transport.go#L848) in case the connection had just died an instant before.  However, isBroken() requires acquiring the persistConn's mutex (https://golang.org/src/net/http/transport.go#L1533) before returning the nil-ness of persistConn.closed.  That same mutex is held by persistConn.ReadLoop() (https://golang.org/src/net/http/transport.go#L1642), which can call pc.readLoopPeekFailLocked(), which calls pc.closeLocked(), which finally calls Close() on the net.Conn.  This isn't a deadlock, but it does block with the persistConn.mu lock held for as long as it takes that Close() to finish, and so any calls to getIdleConn() that end up picking that connection will end up blocking as well.  getIdleConn() removed the pconn from its idleLRU cache, but did not remove it from its list of idle connections, so it may end up getting picked.

Even for cases without a custom transport, there might be a tail-case optimization here for clients that make repeated use of the same HTTP server endpoint with finite re-usability of the TCP connections that could currently block bystander threads unnecessarily on the close() syscall.

Reference Google-internal bug 128442309.
Repository: godot
Issue: Visual scripting methods from parent class not showing
Labels: bug,confirmed,topic:visualscript

<!-- Please search existing issues for potential duplicates before filing yours:
https://github.com/godotengine/godot/issues?q=is%3Aissue
-->

**Godot version:**
<!-- Specify commit hash if non-official. -->
3.1

**OS/device including version:**
<!-- Specify GPU model and drivers if graphics-related. -->
Ubuntu 18.04

**Issue description:**
<!-- What happened, and what was expected. -->
When dragging a node which is an "inherited scene" on to the visual scripting area, I'm able to see methods I've added to the child class, but not methods from the parent class. Also, functions that I have overridden seem to show up twice.

**Steps to reproduce:**
- Create a scene with a script that has `func a` and `func b`
- Create an inherited scene with and extend the script to overrid `func a`
- Add child scene to a new scene as a node and create visual script
- Drag instance of child scene to visual script
- Click `Function` under `VisualScriptFunctionCall` and note only `func a` shows up (twice) but not `func b`

**Minimal reproduction project:**
<!-- Recommended as it greatly speeds up debugging. Drag and drop a zip archive to upload it. -->
[vsinheritance.zip](https://github.com/godotengine/godot/files/2986073/vsinheritance.zip)
Repository: go
Issue: math/big: large fibonacci calculation is faster in GMP
Labels: Performance,NeedsInvestigation

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
go1.12.1 windows/amd64

</pre>

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\Philip\AppData\Local\go-build
set GOEXE=.exe
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Users\Philip\go
set GOPROXY=
set GORACE=
set GOROOT=C:\Go
set GOTMPDIR=
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
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
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\Users\Philip\AppData\Local\Temp\go-build593709294=/tmp/go-build -gno-record-gcc-switches

</pre></details>

### What did you do?

I wrote a Fibonacci calculator in Go using the math/big library. It was ~instant in run time up until n=10^7, after which it was extremely slow. I then used https://github.com/ncw/gmp to replace math/big with a gmp wrapper. No code was changed. 



### What did you expect to see?

A small performance benefit, maybe 2x or 3x.



### What did you see instead?

With the same set of code, gmp quickly calculates n=10^8 in 5 seconds, while the normal math/big library takes more than 5 minutes. Gmp is even able to calculate n=10^9 after 1 minute.
Repository: pytorch
Issue: Rename ignore_index to ignore_target in CrossEntropyLoss
Labels: module: nn,low priority,triaged,enhancement,small

## 📚 Documentation

`ignore_index` is a little confusing because if I want to ignore the target value 0, `ignore_index` suggests (unless one reads the explanation twice over or more) that it's going to ignore the 0th index in the target list which is not what I want as the target value 0 can be at any index/indices in the list.
`ignore_target` makes it quite self-explanatory in my opinion.
Repository: flutter
Issue: Make `Material` cheaper when elevation = 0
Labels: c: new feature,framework,f: material design,c: proposal,P3,team-design,triaged-design

From https://github.com/flutter/flutter/pull/21896#discussion_r267128669 @HansMuller suggested that a `Material` widget with an `elevation` of 0 may be more expensive than it should be.

Perhaps we could optimize `Material` for case where `elevation = 0` to use something like a `Container`.
Repository: vscode
Issue: [folding] custom folding text for folded ranges
Labels: feature-request,editor-folding

Currently when you create custom folds using a FoldingRangeProvider, there is no option to edit the text that is displayed when the text is folded. The editor just displays the first line of the fold with a three dots symbol after it. 

`#region Some region description...`

It would be helpful if it was possible for `FoldingRangeProvider` instances to return ranges with a RangeDisplayName property that would be displayed when the folding range wass collapsed. I'd suggest that the display text would replace the ... symbol and the first line would no longer be displayed as per the behaviour in Visual Studio.