sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: New trait for types which can report memory usage
Labels: T-libs-api,C-feature-request

Hi all,

In the course of implementing the sizeof operator in rustpython, we stumbled upon a feature we possibly lack: the ability to request the true memory usage of a struct. Meaning, the memory usage of the struct itself, as reported by `std::mem::size_of` and friends, but also the size of the dynamically allocated heap structures, such as `Vec`.

Our current approach is to dive into the inner workings of the bigint type, but this is probably undesirable, since the resulting code is unsafe.

The proposed change can be viewed here:

https://github.com/RustPython/RustPython/pull/1172/files

My request, would be to have a trait in the `alloc` crate or `std::mem` crate, which can be implemented by other packages, which support the reporting of dynamic memory by an object.

Example of the trait:

```rust
trait DynamicSizeOf {
    /// Returns the memory used by this type, including all its nested fields
    /// which are dynamically allocated.
    fn sizeof(&self) -> usize
}

impl DynamicSizeOf for BigInt {
    fn sizeof(&self) -> usize {
         // arbitrarily deep query on sub structures memory usage.
    }
}

```

Please also see the related issue here: https://github.com/rust-num/num-bigint/issues/98

Is this a good idea? Are there other options available to achieve the same behavior?

@askaholic and @cuviper what are your opinions on this topic? Do you see other ideas?
Repository: go
Issue: cmd/vet: warn about slice being compared to nil
Labels: NeedsDecision,Analysis

### What version of Go are you using (`go version`)?

go version go1.12.7 windows/amd64

### Does this issue reproduce with the latest release?

yes

### What did you do?

I reported bugs #33103, #33104 and #33105. In the changes to fix these bugs, I noticed a common pattern: a slice is checked for being nil instead of checking its length.

I had thought that `len(slice) == 0` would be the canonical way of testing a slice for emptiness, and I was surprised to find nothing about this topic in [Effective Go](https://golang.org/doc/effective_go.html).

I was also surprised that this bug has occurred in go/printer, which is written by the core go team. Is there a specific reason for using the nil check instead of the len check?

To prevent this kind of bugs in the future, there should be some tool that warns about this situation. My first idea was to integrate this check into vet. Since vet _reports suspicious constructs_, this seems to fit perfectly.
Repository: rust
Issue: Rustdoc should index "Methods from Deref" in search results
Labels: T-rustdoc,C-enhancement,A-rustdoc-search

Rustdoc should index "Methods from Deref" in search results, and mark them somehow. So people be able to find something like `Vec::last` during search.
Repository: terminal
Issue: Screen saver wakeup incomplete
Labels: Help Wanted,Area-Rendering,Issue-Bug,Product-Terminal

When focus is in the Terminal and screen saver kicks in the screen turns black. Then when I move the mouse the screen shows and immediately goes black again. This continues until I move the mouse pointer outside of Terminal window or I click the mouse. This is not happening when focus is outside of Terminal window when screen saver kicks in. In that case wakeup works as expected.

Edit: I incorrectly used term "screen saver". This is related to power saver "screen off" state. Fully reproducible. Must allow screen to stay in the off state for a few seconds to repro.

Windows 18941.rs_prerelease.190713-1700.
Dell XPS 13 9343
Repository: pytorch
Issue: upcoming PEP 554: how much effort we need to support sub-interpreter
Labels: feature,triaged

## 🚀 Feature
support python sub-interpreters and maintains all status of the torch library.

## Motivation

as #10950 demonstrates, the current ``torch`` library cannot lives on multiple sub-interpreter  simultaneously within the same process. But we do need to run python codes on multiple "threads" at the same time for the very reasons why ``torch`` introduces ``torch.multiprocessing`` and ``DistributedDataParallel`` (the single node scenario). As [PEP 554](https://www.python.org/dev/peps/pep-0554/) is proposed back in 2017 and maybe available by 2019 or 2020, I think it is necessary to make use of it because:
- It is easier to sharing data between interpreters than between processes
- It will reduce gpu memory overhead (Every subprocess consume at least 400~500MB gpu memory)
- It can help avoid relatively complex process management problems

And between multi-interpreter and multi-process, there is almost no difference on user coding experience and front-end design, and the changes will be made behind the scene. 

## Pitch

<!-- A clear and concise description of what you want to happen. -->
I think works need to be done on following aspects:
- Changes any global status that should bind to a interpreter to a per-interpreter status set. (the ``detach`` method mentioned in #10950, for example)
  ``Tensor`` lifecycle management maybe not a good example, because it is also a choice that ``Tensor`` can be shared across interpreters.
- Prevent re-initializing and double-finalize for those status that are indeed global. (CUDA initialization, for example)
- Create interface and infrastructure for controlling communication and sharing ``Tensor`` between interpreters. 
- Deprecate ``torch.multiprocessing`` module
Repository: rust
Issue: Tracking issue for `const fn` `type_name`
Labels: T-lang,T-libs-api,B-unstable,C-tracking-issue,A-const-eval,requires-nightly,Libs-Tracked,Libs-Small,S-tracking-needs-summary

This is a tracking issue for making and stabilizing `type_name` as `const fn`. It is not clear whether this is sound. Needs some T-lang discussion probably, too.

Steps needed:

* [x] Implementation (essentially add `const` and `#[rustc_const_unstable(feature = "const_type_name")` to the function and add tests showing that it works at compile-time.
* [x] fix https://github.com/rust-lang/rust/issues/94187
* [ ] check if https://github.com/rust-lang/rust/issues/97156 replicates for `type_name`, too
* [ ] Stabilization
	* Note that stabilization isn't happening any time soon. This function can change its output between rustc compilations and allows breaking referential transparency. Doing so at compile-time has not been discussed fully and has various points that are problematic.
Repository: godot
Issue: Removed signals are still counted by the warning system
Labels: bug,topic:editor,confirmed

**Godot version:**
becbb7b


**Issue description:**
If you remove a user made signal, the warning system will act like it still exists, and complain of missing receiver methods to the previous connections.

**Steps to reproduce:**
1. Make a signal (`signal signal_name`).
2. Connect the signal to anything.
3. Remove the signal creation line.
4. Remove the receiver method. You will see that a warning will appear about it missing.

CC @Paulb23
Repository: go
Issue: net/http: document r.Context().Done() behaviour on cancelled POST request
Labels: Documentation,NeedsInvestigation

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
$ go version

</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

</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.
-->



### What did you expect to see?



### What did you see instead?

---

Recently I found [this question on stack overflow](https://stackoverflow.com/questions/57246852), the OP asked why the `r.Context().Done()` channel does not receive any data on cancelled `POST` request. But it does receive data on cancelled `GET` request.

I tried to find the relevant explanation on the go doc, but I found nothing. Is this not documented?
Repository: youtube-dl
Issue: camwhoreshd.com
Labels: site-support-request

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2019.07.27. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Make sure that all provided video/audio/playlist URLs (if any) are alive and playable in a browser.
- Make sure that site you are requesting is not dedicated to copyright infringement, see https://yt-dl.org/copyright-infringement. youtube-dl does not support such sites. In order for site support request to be accepted all provided example URLs should not violate any copyrights.
- Search the bugtracker for similar site support requests: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm reporting a new site support request
- [x] I've verified that I'm running youtube-dl version **2019.07.27**
- [x] I've checked that all provided URLs are alive and playable in a browser
- [x] I've checked that none of provided URLs violate any copyrights
- [x] I've searched the bugtracker for similar site support requests including closed ones


## Example URLs

<!--
Provide all kinds of example URLs support for which should be included. Replace following example URLs by yours.
-->

http://www.camwhoreshd.com/videos/431328/always-late-she-sayd-just-two-minutes-before-dinner-with-friends-7fe334c374e0e886/

## Description

<!--
Provide any additional information.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->
Repository: vue
Issue: Add JSDoc to types
Labels: improvement

### What problem does this feature solve?
This will improve the developer experience when using Vue in editors such as VSCode.

Currently, the developer must look up the default value in the [documentation](https://vuejs.org/v2/guide/components-props.html#Prop-Validation). And even there it is not clear, without trying it.

### What does the proposed API look like?
One example:

https://github.com/vuejs/vue/blob/b7c2d9366cf731a1551286b8ac712e6e0905070e/types/options.d.ts#L155

This line could get a JSDoc like:
```
Indicates whether the property must be set or is optional. Default is `false`.
```

### Example Result
![Bildschirmfoto 2019-07-29 um 11 03 36](https://user-images.githubusercontent.com/7195563/62035661-91545000-b1f0-11e9-928d-f4f82cd6fb2b.png)

<!-- generated by vue-issues. DO NOT REMOVE -->
Repository: flutter
Issue: Roku support
Labels: c: new feature,engine,dependency: dart,P3,team-engine,triaged-engine

<!-- Thank you for using Flutter!

     If you are looking for support, please check out our documentation
     or consider asking a question on Stack Overflow:
      * https://flutter.dev/
      * https://api.flutter.dev/
      * https://stackoverflow.com/questions/tagged/flutter?sort=frequent

     If you have found a bug or if our documentation doesn't have an answer
     to what you're looking for, then fill our the template below. Please read
     our guide to filing a bug first: https://flutter.dev/docs/resources/bug-reports
-->

## Use case
Running an application in Android TV, Apple TV and Roku from the same codebase.

## Proposal
Flutter should be able to run in Roku also using the same codebase.
Repository: flutter
Issue: Null pointer in Overlay when visiting ancestors
Labels: team,framework,P2,team-framework,triaged-framework

I was poking around `BuildContext` APIs and tried to invoke `visitAncestorElements()` all the way up the tree. I invoked `visitAncestorElements()` from my widget's `build()` method. I ran into a null pointer error for `_offstage` in `Overlay` at:

https://github.com/flutter/flutter/blob/a3cbe2535373d7fd3c3665f65b4af0c97e565561/packages/flutter/lib/src/widgets/overlay.dart#L566

The error was:
```
flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following NoSuchMethodError was thrown building MyDescendant6(dirty):
flutter: The getter 'iterator' was called on null.
flutter: Receiver: null
flutter: Tried calling: iterator
flutter:
flutter: User-created ancestor of the error-causing widget was:
flutter:   Padding
flutter:   file:///Users/[redacted]/buildcontext_ancestors.dart:177:18
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:50:5)
flutter: #1      _TheatreElement.visitChildren (package:flutter/src/widgets/overlay.dart:566:27)
...
```

It's possible that this error was the result of me mis-using the API, but in that case the API docs should probably be updated with the limitation, and maybe an appropriate error should be thrown when this happens.

Flutter Doctor:
```
 • Flutter version 1.8.2-pre.216 at [redacted]
    • Framework revision 24f483cf25 (5 hours ago), 2019-07-28 21:44:21 -0700
    • Engine revision 38ac5f30a7
    • Dart version 2.5.0 (build 2.5.0-dev.1.0 0ca1582afd)
```
Repository: neovim
Issue: :lua io.write() default input/output
Labels: io,lua

<!-- Before reporting: search existing issues and check the FAQ. -->

- `nvim --version`: NVIM v0.4.0-1447-gfe2ada737
- `vim -u DEFAULTS` (version: ) behaves differently? yes
- Operating system/version: macos 10.14
- Terminal name/version: mac terminal

### Steps to reproduce using `nvim -u NORC`
1. `nvim -u NONE`
2. `:lua io.write('aaaa') `
Show as follow:
![image](https://user-images.githubusercontent.com/19503791/62052896-0f444580-b249-11e9-839e-4bf68d30f31b.png)

### Actual behaviour
cmd line mess up
### Expected behaviour
Repository: godot
Issue: StreamPeerBuffer appears empty after writing
Labels: enhancement,documentation

**Godot version:**
3.1.1.stable.official

**OS/device including version:**
Ubuntu 18.04.2 LTS

**Issue description:**
After writing to `b: StreamPeerBuffer`, `b.get_available_bytes()` returns zero and no data can be extracted. After assigning `b.data_array = b.data_array`, `b.get_available_bytes()` returns the correct value and data may be extracted as expected.

**Steps to reproduce:**
```coffeescript
var b := StreamPeerBuffer.new()
b.put_8(123)
print(b.get_available_bytes()) # 0
print(b.get_8()) # 0
b.data_array = b.data_array
print(b.get_available_bytes()) # 1
print(b.get_8()) # 123
```

**Minimal reproduction project:**
[30924.zip](https://github.com/godotengine/godot/files/3442654/30924.zip)
Repository: rust
Issue: Add an option to avoid merging of calls to panic!()
Labels: T-lang,C-feature-request

Given code like:
```rust
pub fn f(v: Option<u32>, k: Option<u32>)  -> u32{
    v.unwrap() + k.unwrap()
}
```

Rust generates
```asm
example::f:
        push    rax
        test    edi, edi
        je      .LBB0_3
        test    edx, edx
        je      .LBB0_3
        mov     eax, ecx
        add     eax, esi
        pop     rcx
        ret
.LBB0_3:
        lea     rdi, [rip + .L__unnamed_1]
        call    qword ptr [rip + core::panicking::panic@GOTPCREL]
        ud2
```
The two calls to wrap are unified and it's not possible to tell which one failed at runtime.

I requested a way to tell LLVM not to do this in https://bugs.llvm.org/show_bug.cgi?id=42783 and Reid pointed me at https://cs.chromium.org/chromium/src/base/immediate_crash.h?l=10&rcl=92d78c90964200453b80fe098b367e0838681d09 which is Chrome's attempt to achieve this.

It turns out that this approach is pretty easily adapted to Rust. Here's a quick rework of the code above showing it off:

```rust
#![feature(asm)]

pub enum FOption<T> {
    Some(T),
    None
}

impl<T> FOption<T> {
     pub fn unwrap(self) -> T {
        match self {
            FOption::Some(val) => val,
            FOption::None => {
                unsafe { asm!("" : : : : "volatile") }
                panic!("called `Option::unwrap()` on a `None` value")
            }
        }
    }
}

pub fn f(v: FOption<u32>, k: FOption<u32>)  -> u32{
    v.unwrap() + k.unwrap()
}
```

which generates:
```asm
example::f:
        push    rax
        test    edi, edi
        jne     .LBB7_3
        test    edx, edx
        jne     .LBB7_4
        mov     eax, ecx
        add     eax, esi
        pop     rcx
        ret
.LBB7_3:
        call    std::panicking::begin_panic
        ud2
.LBB7_4:
        call    std::panicking::begin_panic
        ud2
```
Repository: go
Issue: cmd/compile: redundant moves and stack variables when function using bits.Add64 is inlined
Labels: Performance,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.13beta1 linux/amd64
</pre>

### Does this issue reproduce with the latest release?


### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/jared/.cache/go-build"
GOENV="/home/jared/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/jared/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build580535950=/tmp/go-build -gno-record-gcc-switches"
</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/PWeQpDU4ilg


### What did you expect to see?
No allocation of Zig()'s y variable on the stack, and no code duplication. Something along the lines of... 
```
0x0089 00137 (bug.go:8)	MOVQ	"".x+168(SP), AX
0x0091 00145 (bug.go:8)	ADDQ	AX, AX
0x0094 00148 (bug.go:8)	SBBQ	CX, CX
0x009c 00156 (bug.go:9)	XORQ	AX, CX
```

### What did you see instead?
Execution of the Zig()'s bits.Add64()/ADDQ twice, with unnecessary use of temporary variable y. 

```
0x005a 00090 (bug.go:8)	MOVQ	"".x+168(SP), DX
0x0062 00098 (bug.go:8)	ADDQ	DX, DX
0x0065 00101 (bug.go:8)	MOVQ	DX, "".y+80(SP)
...
0x0089 00137 (bug.go:8)	MOVQ	"".x+168(SP), AX
0x0091 00145 (bug.go:8)	ADDQ	AX, AX
0x0094 00148 (bug.go:8)	SBBQ	AX, AX
0x0097 00151 (<unknown line number>)	NOP
0x0097 00151 (<unknown line number>)	NOP
0x0097 00151 (bug.go:9)	MOVQ	"".y+80(SP), CX
0x009c 00156 (bug.go:9)	XORQ	AX, CX
```
Repository: pytorch
Issue: Enable PyTorch Bfloat16 for CPU and add MKL-DNN bfloat16 optimization for Cooper Lake
Labels: module: performance,module: cpu,triaged

Enable PyTorch Bfloat16 for CPU and add MKL-DNN bfloat16 optimization for Cooper Lake

## Motivation

Bfloat16 is a 16-bit floating point representation with same exponent bit-width as 32-bit floating point representation (FP32). It improves deep learning training performance by reducing both the computation and memory bandwidth while keeps the accuracy at the same level as FP32. It has been adopted by various deep learning HW, and Pytorch added initial Bfloat16 support recently. 

Intel’s upcoming Cooper Lake 14nm Intel Xeon® processor family will add Bfloat16 support, which provides 2x speedup for SIMD FMA instructions and 2x performance benefits on memory access. MKL-DNN v1.0 introduced bfloat16 support and expect more to come in the future releases.  Comparing to FP32 baseline, we projected 1.6x+ performance benefit end to end for a wide range of vision models, and expect benefit for speech-recognition, recommendation engines and machine translation also. 

## Pitch

Support Pytorch bfloat16 feature on CPU path and optimize it for Intel Cooper Lake

## Additional context

On the CPU path, we plan to extend Bfloat16 tensor operation support to have a full coverage as FP16. The input and output tensors are all in public format. We need to override the basic data type operations (like “+”, “-, “*”, “/”) in Bfloat16 class and modify the Bfloat16 tensor operations for special process if needed (like accumulate in FP32 precision in BN). On CPU prior to Cooper Lake, the basic Bfloat16 data operation is emulated, with conversion of input to FP32 and rounding of result to Bfloat16 using Rounding to Nearest Mode. 

On the MKLDNN path, the input tensor is expected to be converted to MKL-DNN blocking format so represented internally as MKL-DNN tensor. The dispatch to MKL-DNN Bfloat16 operation will happen within MKL-DNN operations, not according to first level tensor type id.   

On CPU prior to Cooper Lake, User can run the BFloat16 model with this enabling effort. User may experience lower performance for both CPU and MKL-DNN path on Bfloat16 than FP32 baseline. For best performance, User needs to run Bfloat16 model on MKL-DNN path on Cooper Lake.