Automatically generated C source (RNN)



  • http://cs.stanford.edu/people/karpathy/char-rnn/linux.txt

    The machines are taking over!

    /* Do not be able to be specified on socket error event */
    static void
    ple_bus_type(int s, int event)
    {
    	int tmp;
    
    	if (event == CMD_PPU)
    		param_uninit &= SMBHSTADD;
    	else
    		state_count |= 0x40;	/* Save if needed by sleep on a SMP,data */
    
    	if ((cmd & SMBHST_CMD_CONN) && !invld)
    		goto fault_error;
    
    	reset = ((cmd & S_CR3_NOR) == (SMBHSTADD << 16));
    	expected = 1;
    	sub_info.load = 0;
    
    	/* enable transfer error on error counters */
    	s = &smc->sub_state;
    	rc = prepare_cmd(cdev, EVENT_SBNIC, 0);
    	if (rc)
    		return err;
    
    	err = set_event_size(cmd, 1);
    	if (err)
    		goto fail;
    
    	smp_flush_chunk(space, event);
    
    	sleep_state_valid(smp_processor_id());
    	event = smp_processor_id();
    	event_state_confirm_mult = smp_called_event(event, SMP_DN);
    	smp_wmb();
    	smp_mb();
    	iucv_smp_idle_deferred(pid_dd);
    
    	/*
    	 * Don't miss if the descriptor is running this event
    	 */
    	spin_lock_irqsave(&event_srcu->spu_list_lock, flags);
    	while (npids && !sig_setup) {
    		struct smp_instance *smp_processor = list[i];
    
    		if (pending_identify_sig)
    			complete(&(pids.event));
    		smp_mb();
    		if (pid == 0) {
    			pr_warn("Error: enabling event %x\n", pid);
    			pid_state += s->pid;
    
    			while (pid) {
    				if (smp_processor_id() == -1) {
    					event_for_each_pid(pid, event, upid)
    					break;
    				}
    			}
    		}
    	}
    
    	/* everything is an old user and be allocated */
    	alloc_bool(eventfd);
    
    	for(i = 0; i < pid; ++i)
    		wide_pid_rate = per_cpu(idle_event_filter_idle, i);
    
    	return 1;
    }
    

    Okay, except for... uh, that doesn't compile.

    It'll learn eventually, though.



  • Markov chain programming?



  • @riking said:

    event_for_each_pid(pid, event, upid)

    is missing a semi-colon, and the use of the "err" variable and the goto fail and goto fault_error sear my eyes, but otherwise... this explains all those outsourcing fails! Those offshore coders are actually RNNs!



  • @Lawrence said:

    the goto fail and goto fault_error

    That's accepted practice in the kernel. goto fail is used to simulate RAII without destructors.



  • RNNs were designed, a long time ago, to overcome the limitations of finite state machines, which is what a Markov chain essentially is. RNNs never got off, though: poverty of input, difficulty training, etc. Some of these problems seem to have been overcome, but still there is no guarantee that an RNN can learn the structure of something as trivial as the C syntax. Generating impressing looking garbage it certainly can, though.


Log in to reply